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

installation issue #24

Closed
Xiaolong-han opened this issue Nov 17, 2021 · 4 comments
Closed

installation issue #24

Xiaolong-han opened this issue Nov 17, 2021 · 4 comments

Comments

@Xiaolong-han
Copy link

Hello, thank you for providing such a great framework, but there was an error when I import the module. Could you please offer me a help?
code:

import omegaconf
from openhands.apis.classification_model import ClassificationModel
from openhands.core.exp_utils import get_trainer

cfg = omegaconf.OmegaConf.load("1.yaml")
trainer = get_trainer(cfg)

model = ClassificationModel(cfg=cfg, trainer=trainer)
model.init_from_checkpoint_if_available()
model.fit()

ERROR:
Traceback (most recent call last):
File "/home/hxz/project/pose_SLR/main.py", line 3, in
from openhands.apis.classification_model import ClassificationModel
ModuleNotFoundError: No module named 'openhands.apis'

GokulNC added a commit that referenced this issue Nov 17, 2021
@GokulNC
Copy link
Member

GokulNC commented Nov 17, 2021

Apologies for the inconvenience, and thanks for reporting. It's fixed now.
Please do pip install --upgrade OpenHands and try the same now.

@Xiaolong-han
Copy link
Author

Thanks for your kind help! However, after usingpip install --upgrade OpenHands , there is a new error

Traceback (most recent call last):
File "/home/hxz/project/pose_SLR/main.py", line 9, in
model = ClassificationModel(cfg=cfg, trainer=trainer)
File "/home/hxz/anaconda3/envs/pose_SLR/lib/python3.7/site-packages/openhands/apis/classification_model.py", line 19, in init
super().init(cfg, stage="fit")
File "/home/hxz/anaconda3/envs/pose_SLR/lib/python3.7/site-packages/openhands/apis/inference.py", line 23, in init
self.model = self.create_model(cfg.model)
File "/home/hxz/anaconda3/envs/pose_SLR/lib/python3.7/site-packages/openhands/apis/inference.py", line 31, in create_model
return get_model(cfg, self.datamodule.in_channels, self.datamodule.num_class)
File "/home/hxz/anaconda3/envs/pose_SLR/lib/python3.7/site-packages/openhands/models/loader.py", line 101, in get_model
encoder = load_encoder(config.encoder, in_channels)
File "/home/hxz/anaconda3/envs/pose_SLR/lib/python3.7/site-packages/openhands/models/loader.py", line 17, in load_encoder
from .encoder.graph.pose_flattener import PoseFlattener
File "/home/hxz/anaconda3/envs/pose_SLR/lib/python3.7/site-packages/openhands/models/encoder/init.py", line 1, in
from .graph.pose_flattener import PoseFlattener
ModuleNotFoundError: No module named 'openhands.models.encoder.graph'

@GokulNC
Copy link
Member

GokulNC commented Nov 17, 2021

Oops. Can you please repeat the same and try again now?

@Xiaolong-han
Copy link
Author

Wow, thanks a lot. It works!

@GokulNC GokulNC closed this as completed Nov 17, 2021
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