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

How to use Isaac trained customized models (different number of observations and outputs) #269

Open
DannyChen1994 opened this issue Jan 10, 2024 · 1 comment

Comments

@DannyChen1994
Copy link

I refer to the example in https://github.com/Denys88/rl_games/blob/master/notebooks/train_and_export_onnx_example_lstm_continuous.ipynb run and export the onnx model. But when I tried to modify the config file to modify the network structure, I found that the observation quantity of the LSTM layer was always 3 and could not be modified, and the number of actions output by the network could not be modified.
The errors are as follows:
RuntimeError: Error(s) in loading state_dict for Network: size mismatch for running_mean_std.running_mean: copying a param with shape torch.Size([95]) from checkpoint, the shape in current model is torch.Size([3]). size mismatch for running_mean_std.running_var: copying a param with shape torch.Size([95]) from checkpoint, the shape in current model is torch.Size([3]). size mismatch for a2c_network.sigma: copying a param with shape torch.Size([21]) from checkpoint, the shape in current model is torch.Size([1]).
I guess it is related to 'env_config': {'env_name': 'Pendulum-v1', 'seed': 5}, 'env_name': 'envpool' is related to the content. How to set up my own environment and modify the number of observations and actions?

Looking forward to your reply, Thank you!

@Denys88
Copy link
Owner

Denys88 commented Jan 10, 2024

My only quick Idea is to create very simple empty environment with right spaces.
I will add obs and action space to the pytorch checkpoint in the future. I am sorry for the inconvenience.
Second option is to add this feature (export to the onnx) to the isaacgym directly so it will produce onnx file when training is done.

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