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
Cannot pickle local object #266
Comments
I am not sure. Could you elaborate? |
I literally just started the script, giving one fix parameter since it was required to specify train, validation or test set:
|
Or could you maybe tell me how to run the examples/linkproppred/biokg/run.py script exactly? Maybe there is something I missed. |
Did you try this script? |
I am wondering what if you try Python 3.5. If this works for you, we may need to update the code to make it compatible with the newer Python. I just found this error about pickle, and it seems to be related to the Python version.. |
Hi @weihua916 ! Thanks for the response. Indeed, I think the python version is causing the error.
Could you tell me why the obg package (which I cloned from git via https just now) is out of date? Since I want to run the script run.py in the examples folder, I would need to clone the git repository and cannot use Therefore I thought I'd try with python 3.6. When I created a new environment with python3.6, installing the ogb packed worked. Yet, I get the following error when running the script:
Which means it at least doesn't encounter the previous issue. |
AFAIK, Python 3.6 is required since we make use of |
@rusty1s Thanks for the hint! Actually, without the issue with
By commenting out this line, the script runs. But this is of course not the way to go :D Do you have an idea how to write it differently? |
I see. The correct code would be: save_dict = {
'model_state_dict': model.state_dict(),
'optimizer_state_dict': optimizer.state_dict()},
}
save_dict.update(save_variable_list)
torch.save(save_dict, os.path.join(args.save_path, 'checkpoint')) Does that work for you? |
@rusty1s , yes that made it work. Thanks a lot! |
Thank you two for figuring this out. @sophiakrix could you please create a pull request that works on Python 3.6 or newer? Thanks. |
Hi there!
I was trying to work with the obgl-biokg and execute the script at https://github.com/snap-stanford/ogb/blob/master/examples/linkproppred/biokg/run.py .
I was getting the following error:
Could you help me how to handle this issue?
The text was updated successfully, but these errors were encountered: