valeriechen / ask-your-humans

Dataset collection and training code for "Ask Your Humans: Using Human Instructions to Improve Generalization in Reinforcement Learning"
9 stars 1 forks source link

Pretrained model not accessible #1

Open nweir127 opened 3 years ago

nweir127 commented 3 years ago

Hello, I'm having trouble loading your released hierarchical model checkpoint-- it seems to be trying to access a class from pytorch-a2c-ppo-acktr that doesn't exist.

>>> import torch
>>> torch.load('trained_models/our_model.pt')
/anaconda/envs/mazebase3.6/lib/python3.6/site-packages/torch/serialization.py:434: SourceChangeWarning: source code of class 'pytorchppo.a2c_ppo_acktr.model.Policy' has changed. you can retrieve the original source code by accessing the object's source attribute or set `torch.nn.Module.dump_patches = True` and use the patch tool to revert the changes.
  warnings.warn(msg, SourceChangeWarning)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/anaconda/envs/mazebase3.6/lib/python3.6/site-packages/torch/serialization.py", line 367, in load
    return _load(f, map_location, pickle_module)
  File "/anaconda/envs/mazebase3.6/lib/python3.6/site-packages/torch/serialization.py", line 538, in _load
    result = unpickler.load()
AttributeError: Can't get attribute 'MazeBaseBase' on <module 'pytorchppo.a2c_ppo_acktr.model' from '/path/to/ask-your-humans/mazebase-training/pytorchppo/a2c_ppo_acktr/model.py'>

Any advice would be greatly appreciated.

valeriechen commented 3 years ago

You're right, sorry about that - I'll update the code to fix this issue this weekend!

nweir127 commented 3 years ago

Thanks very much!

Also FYI-- I wasn't able to run pip install -r requirements in mazebase-training and had to install various packages using conda install instead. I am assuming your environment is python 3.6?

valeriechen commented 3 years ago

Hi! Here's how you can run our model:

Happy to help with any other questions you might have!