Tandon-A / emotic

PyTorch implementation of Emotic CNN methodology to recognize emotions in images using context information.
MIT License
134 stars 47 forks source link

TypeError: the first argument must be callable #23

Closed fyhfyhfyh123456 closed 1 year ago

fyhfyhfyh123456 commented 1 year ago

(emotic) root@autodl-container-919011829e-7f6a3e29:~/autodl-tmp/emotic-master# python main.py --mode train --data_path data/Emotic/emotic_pre --experiment_path proj/debug_exp mode train train context (23266, 224, 224, 3) body (23266, 128, 128, 3) cat (23266, 26) cont (23266, 3) val context (3315, 224, 224, 3) body (3315, 128, 128, 3) cat (3315, 26) cont (3315, 3) train loader 448 val loader 64 Traceback (most recent call last): File "main.py", line 88, in train_emotic(result_path, model_path, train_log_path, val_log_path, ind2cat, ind2vad, context_norm, body_norm, args) File "/root/autodl-tmp/emotic-master/train.py", line 174, in train_emotic model_context, model_body = prep_models(context_model=args.context_model, body_model=args.body_model, model_dir=model_path) File "/root/autodl-tmp/emotic-master/prepare_models.py", line 26, in prep_models model = torch.load(model_file, map_location=lambda storage, loc: storage, pickle_module=pickle) File "/root/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 713, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) File "/root/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 738, in _legacy_load class UnpicklerWrapper(pickle_module.Unpickler): # type: ignore[name-defined] TypeError: the first argument must be callable

Tandon-A commented 1 year ago

Hi @fyhfyhfyh123456,

Can you try the solution as mentioned here?

Best, Abhishek