Closed sddthree closed 5 months ago
set return_state_dicts=True
@louisabraham is it possible to set
return_state_dicts=True
as default value across interfaces.py
? LassoNet breaks without setting it to be true.
The reason why I didn't put it as default is because of the large memory consumption. I could add some logic to make the error message more clear.
@louisabraham FYI, running LassoNet 0.0.19 as-is on the example diabetes.py yields the same error
TypeError: Expected state_dict to be dict-like, got <class 'NoneType'>.
Can you give your full use case? You should just put the argument mentioned above if you call the path function directly.
It's just this example code here I'm afraid https://github.com/lasso-net/lassonet/blob/master/examples/diabetes.py Running it as-is will give error
Hey! should be fixed now :)
If you read this: Just add return_state_dicts=True
to your model.path
call!
Thank you @louisabraham !!!
TypeError: Expected state_dict to be dict-like, got <class 'NoneType'>.
When I runing example : python friedman.py path_multiplier: 1.01 M: 10 Traceback (most recent call last): File "friedman.py", line 53, in
min(rrmse(y_test, model.load(save).predict(X_test)) for save in path),
File "friedman.py", line 53, in
min(rrmse(y_test, model.load(save).predict(X_test)) for save in path),
File "/opt/conda/envs/lassonet/lib/python3.8/site-packages/lassonet-0.0.15-py3.8.egg/lassonet/interfaces.py", line 524, in load
self.model.load_state_dict(state_dict)
File "/opt/conda/envs/lassonet/lib/python3.8/site-packages/torch/nn/modules/module.py", line 2140, in load_state_dict
raise TypeError(f"Expected state_dict to be dict-like, got {type(state_dict)}.")
TypeError: Expected state_dict to be dict-like, got <class 'NoneType'>.
since my cuda is 12, so my torch using the latest versin. torch 2.3.0 torchvision 0.18.0
how to solve it?