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

generate unnorma images when inference #8

Open
Blackkinggg opened this issue May 23, 2022 · 7 comments
Open

generate unnorma images when inference #8

Blackkinggg opened this issue May 23, 2022 · 7 comments

Comments

@Blackkinggg
Copy link

Blackkinggg commented May 23, 2022

I can generated right images using the demo.py, but got below images when used the inference.py
1653305889(1)

@Blackkinggg Blackkinggg changed the title generate error images when inference generate unnorma images when inference May 23, 2022
@Blackkinggg
Copy link
Author

Blackkinggg commented May 24, 2022

There are also problems in the training stage.
Neural-Texture-Extraction-Distribution/util/visualization/linear_attention.py:

def attn2image(source_softmax, seg_query, input_image):
target_list = []
image_size = input_image.shape[2:]
for softmax, query in zip(source_softmax, seg_query):
b, num_label, h, w = query.shape
input_resize = F.interpolate( input_image, (h,w) )
input_resize = input_resize.view(b, -1, h*w)
extracted = torch.einsum('bkm,bvm->bvk', softmax, input_resize)
query = F.softmax(query.view(b, num_label, -1), 1)
estimated_target = torch.einsum('bkm,bvk->bvm', query, extracted)
estimated_target = estimated_target.view(b, -1, h, w)
target_list.append(F.interpolate(estimated_target, image_size))
target_gen = torch.cat(target_list, 3)
return target_gen

The source_softmax is an empty list.

@RenYurui
Copy link
Owner

Hi!
Is the checkpoint loaded successfully while inference?
Can you provide the messages when you run inference.py

@Blackkinggg
Copy link
Author

Hi! Is the checkpoint loaded successfully while inference? Can you provide the messages when you run inference.py

您好,我使用的原始代码,看起来inference没有成功load模型,没有报错信息,直接生成上面的图像

@RenYurui
Copy link
Owner

When you run inference.py without training the model. You may need to load the model by adding --which_iter such as:

python -m torch.distributed.launch \
--nproc_per_node=1 \
--master_port 12345 inference.py \
--config ./config/fashion_512.yaml \
--name fashion_512 \
--no_resume \
--output_dir ./result/fashion_512/inference \
--which_iter 495400

@SHULJJ
Copy link

SHULJJ commented Nov 2, 2022

hello ,请问你解决了这个问题吗
image

@SHULJJ
Copy link

SHULJJ commented Nov 2, 2022

There are also problems in the training stage. Neural-Texture-Extraction-Distribution/util/visualization/linear_attention.py:

def attn2image(source_softmax, seg_query, input_image): target_list = [] image_size = input_image.shape[2:] for softmax, query in zip(source_softmax, seg_query): b, num_label, h, w = query.shape input_resize = F.interpolate( input_image, (h,w) ) input_resize = input_resize.view(b, -1, h*w) extracted = torch.einsum('bkm,bvm->bvk', softmax, input_resize) query = F.softmax(query.view(b, num_label, -1), 1) estimated_target = torch.einsum('bkm,bvk->bvm', query, extracted) estimated_target = estimated_target.view(b, -1, h, w) target_list.append(F.interpolate(estimated_target, image_size)) target_gen = torch.cat(target_list, 3) return target_gen

The source_softmax is an empty list.
请问你解决这个问题了吗

@shrinivasait
Copy link

Hi @Blackkinggg, How did generate pose key points?

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

4 participants