From 09a558c2c97958ac7dda507746748259c1a8c37b Mon Sep 17 00:00:00 2001 From: x54-729 <17307130121@fudan.edu.cn> Date: Mon, 12 Sep 2022 14:36:27 +0800 Subject: [PATCH] small change for tests --- tests/core/drivers/paddle_driver/test_single_device.py | 1 - tests/core/drivers/torch_driver/test_fsdp.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/core/drivers/paddle_driver/test_single_device.py b/tests/core/drivers/paddle_driver/test_single_device.py index e5e68e58..6726069e 100644 --- a/tests/core/drivers/paddle_driver/test_single_device.py +++ b/tests/core/drivers/paddle_driver/test_single_device.py @@ -635,7 +635,6 @@ def test_save_and_load_model(only_state_dict): driver2.load_model(path, only_state_dict) for batch in dataloader: - print("?") batch = driver1.move_data_to_device(batch) res1 = driver1.model.evaluate_step(**batch) res2 = driver2.model.evaluate_step(**batch) diff --git a/tests/core/drivers/torch_driver/test_fsdp.py b/tests/core/drivers/torch_driver/test_fsdp.py index df8f9e91..0046251a 100644 --- a/tests/core/drivers/torch_driver/test_fsdp.py +++ b/tests/core/drivers/torch_driver/test_fsdp.py @@ -6,7 +6,6 @@ import re import pytest from fastNLP.core.controllers.trainer import Trainer -from torchmetrics import Accuracy from fastNLP.core.callbacks import CheckpointCallback from tests.helpers.models.torch_model import TorchNormalModel_Classification_1 from tests.helpers.datasets.torch_data import TorchNormalDataset_Classification, TorchArgMaxDataset @@ -18,6 +17,7 @@ if _NEED_IMPORT_TORCH: import torch.distributed as dist from torch.optim import SGD from torch.utils.data import DataLoader + from torchmetrics import Accuracy @dataclass