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

ValueError: Cannot assign to variable block_1_1_ds_conv1/filters:0 due to variable shape (1, 1, 64, 256) and value shape (64,) are incompatible #348

Open
AndreyStille opened this issue Mar 3, 2021 · 2 comments

Comments

@AndreyStille
Copy link

Please help.

Cannot load weights using infer,py. Weights are taken from google drive
(lightweight_openpose_resnet50.npz)

import cv2
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from hyperpose import Config,Model,Dataset
from hyperpose.Dataset import imread_rgb_float,imwrite_rgb_float
Config.set_model_name("LightweightOpenpose")
Config.set_model_backbone(Config.BACKBONE.Resnet50)
Config.set_model_type(Config.MODEL.LightweightOpenpose)
config=Config.get_config()

#get and load model
model=Model.get_model(config)
weight_path=f"{config.model.model_dir}/newest_model.npz"
model.load_weights('/content/hyperpose/save_dir/openpose/model_dir/newest_model.npz')

@orestis-z
Copy link

Tried setting Config.set_model_backbone(Config.BACKBONE.Vggtiny) but the same error occurs

@Gyx-One
Copy link
Contributor

Gyx-One commented Nov 13, 2021

Hello! @AndreyStille
Sorry to response so late.
The infer.py is reported to have several issues and thus deprecated now, please use python_demo.py (which is tested to make sure it can work with the existing model weights).
As for the shape mismatch issue, this has been fixed in the newest commit, please download the newest model weights here and they should work well with the python_demo.py

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