fdjingyuan / Deep-Fashion-Analysis-ECCV2018

Codes of ECCV 2018 workshop paper "Deep Fashion Analysis with Feature Map Upsampling and Landmark-driven Attention"
83 stars 27 forks source link

Error while performing testing on a real image #14

Open indersingh17188 opened 3 years ago

indersingh17188 commented 3 years ago

Hello,

I have successfully created a small part of the code and modified existing codes which can do the prediction on an input image. Basically I have changed input sample in the networks.py -- forward function from: _vgg16_output = self.vgg16extractor(sample['image']) to _vgg16_output = self.vgg16_extractor(torch.from_numpy(sample.astype(np.float32)).reshape(1, 3, image_w, imageh).cuda()) where sample in this case is the numpy array of input image.

However, during the concatenation of landmarks map (lm_merge_map) from attention branch and convolution features (conv_feature) from conv43 layer I am getting this error: RuntimeError: Sizes of tensors must match except in dimension 2. Got 60 and 28 (The offending index is 0)_

where the dimensions of both tensors are:

_conv_feature: torch.Size([1, 512, 60, 77]), lm_mergemap: torch.Size([1, 1, 28, 28])

and dimensions of input image is:

_image_h: 622, image_w: 486 , channelnum: 3

I am attaching the screenshot as well. Any help will be greatly appreciated. Thank you so much in advance.

image

young-yangb commented 3 years ago

@indersingh17188 Hi,Did you succeed in reproducing the results on Attribute Prediction?

haduo0825 commented 2 years ago

@indersingh17188 my friend, did u solved this problem?