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

Error in eval.py #7

Open
eh102 opened this issue Sep 18, 2023 · 2 comments
Open

Error in eval.py #7

eh102 opened this issue Sep 18, 2023 · 2 comments

Comments

@eh102
Copy link

eh102 commented Sep 18, 2023

Hello, I want to run eval.py in HCVRP_DRL. I have followed the input instructions in the official documentation and made sure that the dataset and model are loaded correctly, and the environment matches the documentation.However, I encountered the following error message. Does anyone know how to solve it?

Traceback (most recent call last):
File "eval.py", line 226, in
eval_dataset(dataset_path, width, opts.softmax_temperature, opts)
File "eval.py", line 59, in eval_dataset
model, _ = load_model(opts.model, opts.obj)
File "/home/ubuntu/Desktop/HCVRP_DRL-main/fleet_v3/utils/functions.py", line 124, in load_model
load_data = torch_load_cpu(model_filename)
File "/home/ubuntu/Desktop/HCVRP_DRL-main/fleet_v3/utils/functions.py", line 27, in torch_load_cpu
return torch.load(load_path, map_location=lambda storage, loc: storage) # Load on CPU
File "/home/ubuntu/anaconda3/envs/hcvrp/lib/python3.7/site-packages/torch/serialization.py", line 426, in load
return _load(f, map_location, pickle_module, **pickle_load_args)
File "/home/ubuntu/anaconda3/envs/hcvrp/lib/python3.7/site-packages/torch/serialization.py", line 613, in _load
result = unpickler.load()
ModuleNotFoundError: No module named 'nets.attention_model_minsum'

@NEWRING
Copy link

NEWRING commented Sep 28, 2023

Hi, I have met the similar error like you. Have you solved it?

My error message:
Traceback (most recent call last):
File "...\lib\site-packages\torch\serialization.py", line 713, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "...\lib\site-packages\torch\serialization.py", line 930, in _legacy_load
result = unpickler.load()
File "...\lib\site-packages\torch\serialization.py", line 746, in find_class
return super().find_class(mod_name, name)
ModuleNotFoundError: No module named 'problems.hcvrp.problem_hcvrp_minsum'

@eh102
Copy link
Author

eh102 commented Sep 29, 2023

I changed my GPU to a 2080ti, modified the settings to the same as the official text Python 3.7, Pytorch 1.3.0. After that it worked fine with my own trained model. So I think it may be a compatibility issue with GPU, CUDA, Python, Pytroch.

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

2 participants