[Fix] Fix mmengine dump of tversky ut in dev-1.x (#2001)

pull/2005/head
MengzhangLI 2022-08-31 12:01:55 +08:00 committed by GitHub
parent ee7f340dff
commit 8ce7055d1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -36,11 +36,12 @@ def test_tversky_lose():
import os
import tempfile
import mmcv
import mmengine
import numpy as np
tmp_file = tempfile.NamedTemporaryFile()
mmcv.dump([1.0, 2.0, 3.0], f'{tmp_file.name}.pkl', 'pkl') # from pkl file
mmengine.dump([1.0, 2.0, 3.0], f'{tmp_file.name}.pkl',
'pkl') # from pkl file
loss_cfg = dict(
type='TverskyLoss',
class_weight=f'{tmp_file.name}.pkl',