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

TypeError: __init__() missing 1 required positional argument: 'hparams' #35

Open
tanjary21 opened this issue Mar 18, 2021 · 3 comments
Open

Comments

@tanjary21
Copy link

tanjary21 commented Mar 18, 2021

Hi there!

I've been trying to run the code on colab on MOT17 dataset. I followed all the instructions and I managed to get the network to train.

The 'python scripts/evaluate.py' command seems to fail though. This is the error I get:

WARNING - evaluate - No observers have been added to this run
INFO - evaluate - Running command 'main'
INFO - evaluate - Started
ERROR - evaluate - Failed after 0:00:00!
Traceback (most recent calls WITHOUT Sacred internals):
File "scripts/evaluate.py", line 34, in main
model = MOTNeuralSolver.load_from_checkpoint(checkpoint_path=_config['ckpt_path'] if osp.exists(_config['ckpt_path']) else osp.join(OUTPUT_PATH, _config['ckpt_path']))
File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/core/saving.py", line 156, in load_from_checkpoint
model = cls._load_model_state(checkpoint, strict=strict, kwargs)
File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/core/saving.py", line 198, in _load_model_state
model = cls(
_cls_kwargs)
TypeError: init() missing 1 required positional argument: 'hparams'

Any ideas as to how to fix this? Thanks in advance

@tanjary21
Copy link
Author

To anyone who ran into this issue, the solution is to install older versions of the packages used. pytorch_lightning, sacred, all these funky libraries need to be the same as those specified in their environment.yaml file. Furthermore, if you run into issues creating a new environment with the environment.yaml file, install the important ones(pytorch, cuda, sacred, torch-scatter, torch-sparse, pytorch-lightning, pulp etc) manually, one by one, into a new environment, with default dependencies

@mqingkui
Copy link

mqingkui commented Jun 4, 2021

install pytorch-lightning==0.7.6 works!

@triethanol
Copy link

Hi there!

I've been trying to run the code on colab on MOT17 dataset. I followed all the instructions and I managed to get the network to train.

The 'python scripts/evaluate.py' command seems to fail though. This is the error I get:

WARNING - evaluate - No observers have been added to this run
INFO - evaluate - Running command 'main'
INFO - evaluate - Started
ERROR - evaluate - Failed after 0:00:00!
Traceback (most recent calls WITHOUT Sacred internals):
File "scripts/evaluate.py", line 34, in main
model = MOTNeuralSolver.load_from_checkpoint(checkpoint_path=_config['ckpt_path'] if osp.exists(_config['ckpt_path']) else osp.join(OUTPUT_PATH, _config['ckpt_path']))
File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/core/saving.py", line 156, in load_from_checkpoint
model = cls._load_model_state(checkpoint, strict=strict, kwargs) File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/core/saving.py", line 198, in _load_model_state model = cls(_cls_kwargs)
TypeError: init() missing 1 required positional argument: 'hparams'

Any ideas as to how to fix this? Thanks in advance

Hi, I'm also trying to run this on colab, but I haven't been successful. Can you give some pointers on what to do? It would be great if you could just list down the steps you followed. So I tried installing conda and then activated the environment. But I am having to activate the environment individually in every cell. Although I assume that's working when I ran the train_object_detect.py it's giving a module not found error. Can you please help?

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

3 participants