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

Issue using Pytorch quantized models #396

Closed
nik1806 opened this issue Aug 24, 2022 · 4 comments · Fixed by #400
Closed

Issue using Pytorch quantized models #396

nik1806 opened this issue Aug 24, 2022 · 4 comments · Fixed by #400

Comments

@nik1806
Copy link
Contributor

nik1806 commented Aug 24, 2022

Traceback (most recent call last):
File "driver.py", line 221, in
main()
File "driver.py", line 197, in main
pilot = Pilot(app_configuration, controller, app_configuration.brain_path)
File "/root/BehaviorMetrics/behavior_metrics/pilot.py", line 69, in init
self.initialize_robot()
File "/root/BehaviorMetrics/behavior_metrics/pilot.py", line 115, in initialize_robot
self.configuration.experiment_model, self.configuration.brain_kwargs)
File "/root/BehaviorMetrics/behavior_metrics/brains/brains_handler.py", line 28, in init
self.load_brain(brain_path)
File "/root/BehaviorMetrics/behavior_metrics/brains/brains_handler.py", line 55, in load_brain
self.active_brain = Brain(self.sensors, self.actuators, model=self.model, handler=self, config=self.config)
File "/root/BehaviorMetrics/behavior_metrics/brains/f1/brain_f1_torch.py", line 64, in init
self.net = torch.jit.load(PRETRAINED_MODELS + model).to(self.device)
File "/usr/local/lib/python3.7/dist-packages/torch/jit/_serialization.py", line 161, in load
cpp_module = torch._C.import_ir_module(cu, str(f), map_location, _extra_files)
RuntimeError:
Unknown type name 'NoneType':
Serialized File "code/torch/torch/nn/quantized/modules/linear.py", line 14
return (qweight, bias, training, dtype)
def setstate(self: torch.torch.nn.quantized.modules.linear.LinearPackedParams,
state: Tuple[Tensor, Optional[Tensor], bool, int]) -> NoneType:
~~~~~~~~ <--- HERE
self.dtype = (state)[3]
_0 = (self).set_weight_bias((state)[0], (state)[1], )

@nik1806
Copy link
Contributor Author

nik1806 commented Aug 29, 2022

The problem was with installed Pytorch version. I upgraded it to 1.11.0 and everything worked as expected.

@nik1806 nik1806 closed this as completed Aug 29, 2022
@sergiopaniego
Copy link
Member

sergiopaniego commented Aug 31, 2022

We should update the requirements.txt then, right? @nik1806

@sergiopaniego sergiopaniego reopened this Aug 31, 2022
@nik1806
Copy link
Contributor Author

nik1806 commented Aug 31, 2022

Yes, we can update to latest work of PyTorch.

@sergiopaniego
Copy link
Member

Great! Can you open the new PR, please?

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

Successfully merging a pull request may close this issue.

2 participants