Can't load model when using HER + SAC
See original GitHub issueWhen 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:
- Created 4 years ago
- Comments:5
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, that was definitely it. Updating my local version of numpy to match the one on the remote computer fixed the issue.
@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.