question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't load model when using HER + SAC

See original GitHub issue

When loading a model using HER + SAC I get the following error:

Traceback (most recent call last):
  File "main.py", line 35, in <module>
    model = HER.load('test.zip', env = env)
  File "/home/tirafesi/.local/lib/python3.6/site-packages/stable_baselines/her/her.py", line 148, in load
    data, _ = cls._load_from_file(load_path, custom_objects=custom_objects)
  File "/home/tirafesi/.local/lib/python3.6/site-packages/stable_baselines/common/base_class.py", line 652, in _load_from_file
    data = json_to_data(json_data, custom_objects=custom_objects)
  File "/home/tirafesi/.local/lib/python3.6/site-packages/stable_baselines/common/save_util.py", line 120, in json_to_data
    base64.b64decode(serialization.encode())
ModuleNotFoundError: No module named 'numpy.random._pickle'
> pip freeze | grep -E 'numpy|stable'
numpy==1.17.3
stable-baselines==2.10.0a0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
siferaticommented, Mar 12, 2020

Yes, that was definitely it. Updating my local version of numpy to match the one on the remote computer fixed the issue.

0reactions
Miffylicommented, Apr 1, 2020

@erwincoumansepic

If you are not able to load the full model, you can still try load_parameters function to load the network weights of that saved model. You need to create model similar to one stored in the model file manually, though.

As for the support independent of numpy version: Saving still uses pickling for some parts of the models, which is often pretty sensitive to library versions. In v3, with PyTorch backend, we will have more robust saving/loading.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Facts could not be loaded - error with SAC model
One of the users is getting an error 'Facts could not be loaded' while accessing a model based on an import data connection...
Read more >
SAC — Stable Baselines 2.10.3a0 documentation
The SAC model does not support stable_baselines.common.policies because it uses double q-values and value estimation, as a result it must use its own...
Read more >
Retraining model after loading not working while following #30
Check what is the performance of model upon saving with some evaluation games (no training), then load the policy and evaluate again.
Read more >
Resolved - Can't load trained model for inference - Unity Forum
Please provide : The model you are trying to use. The versions of C# ml-agents you are using. A print out of the...
Read more >
Use SAC to troubleshoot your Windows instance
Limitations. If you enable SAC on an instance, the EC2 services that rely on password retrieval will not work from the Amazon EC2...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found