mobicom24 / RF-Diffusion

GNU General Public License v3.0
115 stars 15 forks source link

EOFError running inference.py #15

Open jmckendry-aw opened 3 weeks ago

jmckendry-aw commented 3 weeks ago

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 commented 3 weeks ago

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.