q-trading-pytorch icon indicating copy to clipboard operation
q-trading-pytorch copied to clipboard

Error loading model

Open aidonchuk opened this issue 4 years ago • 1 comments

Hi! When loading model I get this. Can you help pls.

Traceback (most recent call last): File "/workspace/q-trading-pytorch/evaluate.py", line 11, in agent = Agent(window_size, True) File "/workspace/q-trading-pytorch/agent/agent.py", line 29, in init self.target_net = torch.load('models/target_model.pth', map_location=device) File "/opt/conda/lib/python3.6/site-packages/torch/serialization.py", line 422, in load return _load(f, map_location, pickle_module, **pickle_load_args) File "/opt/conda/lib/python3.6/site-packages/torch/serialization.py", line 609, in _load result = unpickler.load() File "/opt/conda/lib/python3.6/site-packages/torch/serialization.py", line 572, in persistent_load deserialized_objects[root_key] = restore_location(obj, location) File "/opt/conda/lib/python3.6/site-packages/torch/serialization.py", line 445, in restore_location result = map_location(storage, location) TypeError: 'int' object is not callable

aidonchuk avatar Mar 06 '20 18:03 aidonchuk

The pretrained model is not included in the repo, you need to run train.py first to train the model then you will see the model saved in models folder.

viuts avatar Mar 09 '20 10:03 viuts