cavalleria / cavaface

face recognition training project(pytorch)
MIT License
459 stars 87 forks source link

Resume training, load the model and report an error #75

Closed Nakupenda-7 closed 3 years ago

Nakupenda-7 commented 3 years ago

The configuration is the same environment Loading Backbone Checkpoint './model/EfficientNet-b0/model/Epoch_36_Time_2021-01-07-00-31_checkpoint.pth' Traceback (most recent call last): File "train.py", line 370, in main() File "train.py", line 44, in main mp.spawn(main_worker, nprocs=ngpus_per_node, args=(ngpus_per_node, cfg, val_dataset)) File "/root/miniconda3/envs/myconda/lib/python3.7/site-packages/torch/multiprocessing/spawn.py", line 171, in spawn while not spawn_context.join(): File "/root/miniconda3/envs/myconda/lib/python3.7/site-packages/torch/multiprocessing/spawn.py", line 118, in join raise Exception(msg) Exception:

-- Process 0 terminated with the following error: Traceback (most recent call last): File "/root/miniconda3/envs/myconda/lib/python3.7/site-packages/torch/multiprocessing/spawn.py", line 19, in _wrap fn(i, *args) File "/mnt/cavaface.pytorch/train.py", line 222, in main_worker backbone.load_state_dict(torch.load(BACKBONE_RESUME_ROOT, map_location=loc)) File "/root/miniconda3/envs/myconda/lib/python3.7/site-packages/torch/serialization.py", line 528, in load return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args) File "/root/miniconda3/envs/myconda/lib/python3.7/site-packages/torch/serialization.py", line 782, in _load result = unpickler.load() ModuleNotFoundError: No module named 'torch'

cavalleria commented 3 years ago

the error is ModuleNotFoundError: No module named 'torch', make sure you have installed pytorch and import it.

Nakupenda-7 commented 3 years ago

the error is ModuleNotFoundError: No module named 'torch', make sure you have installed pytorch and import it.

Of course, I configured the pytorch environment and imported pytorch, but this error still occurred!

Nakupenda-7 commented 3 years ago

the error is ModuleNotFoundError: No module named 'torch', make sure you have installed pytorch and import it.

the correct error is ModuleNotFoundError: No module named '—torch—'