emotic icon indicating copy to clipboard operation
emotic copied to clipboard

TypeError: the first argument must be callable

Open fyhfyhfyh123456 opened this issue 1 year ago • 2 comments

Traceback (most recent call last): File "main.py", line 86, in train_emotic(result_path, model_path, train_log_path, val_log_path, ind2cat, ind2vad, context_norm, body_norm, args) File "D:\2022-next\2022-text\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 "D:\2022-next\2022-text\emotic-master\prepare_models.py", line 28, in prep_models model = torch.load(model_file, map_location=lambda storage, loc: storage, pickle_module=pickle) File "D:\anaconda3\envs\pytorch114\lib\site-packages\torch\serialization.py", line 795, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) File "D:\anaconda3\envs\pytorch114\lib\site-packages\torch\serialization.py", line 820, in _legacy_load class UnpicklerWrapper(pickle_module.Unpickler): # type: ignore[name-defined] TypeError: the first argument must be callable

fyhfyhfyh123456 avatar May 09 '23 13:05 fyhfyhfyh123456

I didn't encounter this problem when I first trained, and after a while when I trained for the second time, I encountered this problem when I ran python main.py, and I checked a lot of information and couldn't find where the problem was. Waiting for everyone's exchange, thank you very much

fyhfyhfyh123456 avatar May 09 '23 13:05 fyhfyhfyh123456

I used gpt to help solve this problem and it seems to be useful.

code

AA1HSHH avatar Jan 08 '24 08:01 AA1HSHH