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: 'bytes' object cannot be interpreted as an integer #669

Closed
Maekfei opened this issue Jul 9, 2024 · 4 comments
Closed

TypeError: 'bytes' object cannot be interpreted as an integer #669

Maekfei opened this issue Jul 9, 2024 · 4 comments
Labels
Milestone

Comments

@Maekfei
Copy link

Maekfei commented Jul 9, 2024

When I want to load some graph data,it happens. My python version is 3.10, dill version is 0.3.8. Does anyone know how to solve this problem?

TypeError Traceback (most recent call last)
Cell In[2], line 31
29 print('Start Loading Graph Data...')
30 with open(args.data_dir, 'rb') as f:
---> 31 graph = renamed_load(f)
32 print('Finish Loading Graph Data!')

File /mnt/workspace/GPT-GNN-master/example_OAG/GPT_GNN/data.py:274, in renamed_load(file_obj)
273 def renamed_load(file_obj):
--> 274 return RenameUnpickler(file_obj).load()

File /usr/local/lib/python3.10/site-packages/dill/_dill.py:444, in Unpickler.load(self)
443 def load(self): #NOTE: if settings change, need to update attributes
--> 444 obj = StockUnpickler.load(self)
445 if type(obj).module == getattr(_main_module, 'name', 'main'):
446 if not self._ignore:
447 # point obj class to main

@Maekfei
Copy link
Author

Maekfei commented Jul 9, 2024

I am very sure the data is not the issue because I am just trying to reproduce the code from this project.https://github.com/acbull/GPT-GNN

@mmckerns
Copy link
Member

mmckerns commented Jul 9, 2024

Can you post a minimal code example that reproduces your issue, and the full traceback if possible? Otherwise it's difficult to diagnose anything.

@Maekfei
Copy link
Author

Maekfei commented Jul 9, 2024

Can you post a minimal code example that reproduces your issue, and the full traceback if possible? Otherwise it's difficult to diagnose anything.
Thank you for your reply,bro. I found the cause of the error. I think dill is not very compatible with Python 3.10. I successfully ran the code using Python 3.6.

@Maekfei Maekfei closed this as completed Jul 9, 2024
@mmckerns
Copy link
Member

mmckerns commented Jul 9, 2024

dill currently is maintained to support the pickling of the majority of builtin objects for python 3.8 to 3.12, so I'm a bit surprised that you are using 3.6. I assume you are using an old version of dill...

@mmckerns mmckerns added this to the dill-0.3.9 milestone Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants