Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: the first argument must be callable #27

Open
fyhfyhfyh123456 opened this issue May 9, 2023 · 2 comments · May be fixed by #28
Open

TypeError: the first argument must be callable #27

fyhfyhfyh123456 opened this issue May 9, 2023 · 2 comments · May be fixed by #28

Comments

@fyhfyhfyh123456
Copy link

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
Copy link
Author

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

@AA1HSHH
Copy link

AA1HSHH commented Jan 8, 2024

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

code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants