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

EOFError running inference.py #15

Open
jmckendry-aw opened this issue Oct 21, 2024 · 1 comment
Open

EOFError running inference.py #15

jmckendry-aw opened this issue Oct 21, 2024 · 1 comment

Comments

@jmckendry-aw
Copy link

I am trying to run inference.py in Ubuntu 20.04 with an RTX 3060 with 12GB. I created a Conda environment with Python 3.8 and set up required packages following the instructions here, downloaded and unzipped the dataset.zip and model.zip files, and got the following traceback:
(RF-Diffusion) jfm@jfm-XPS-8940:~/RF-Diffusion$ python3 inference.py --task_id 0
inference.py:278: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
checkpoint = torch.load(f'{model_dir}/weights.pt')
Traceback (most recent call last):
File "inference.py", line 368, in
main(parser.parse_args())
File "inference.py", line 278, in main
checkpoint = torch.load(f'{model_dir}/weights.pt')
File "/home/jfm/anaconda3/envs/RF-Diffusion/lib/python3.8/site-packages/torch/serialization.py", line 1114, in load
return _legacy_load(
File "/home/jfm/anaconda3/envs/RF-Diffusion/lib/python3.8/site-packages/torch/serialization.py", line 1338, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
EOFError: Ran out of input

What am I doing wrong?
Also, I tried to pass a --model_dir arg with "--model_dir '/home/jfm/RF-Diffusion/model/'" and I got an error
IsADirectoryError: [Errno 21] Is a directory: '/home/jfm/RF-Diffusion/model/'
So what is the correct syntax for passing a directory?

Thanks for any help.

@jmckendry-aw
Copy link
Author

Never mind, I figured it out. For the sake of anyone else who runs into the same problem: if you unzip the model.zip directory by selecting "extract here" in Nautilus. the weights file model/wifi/b32-256-100s/weights.pt will be empty and you will get the EOFError. So you should unzip it from the command line, "unzip -q model.zip" if the zip file is already in the RF-Diffusion directory. The weights.pt file should be 234.8 MB.

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

No branches or pull requests

1 participant