Open SikandAlex opened 4 years ago
I am having this exact issue - the results are all weird.
I followed the getting started.
I get similar results to the above for the resnet50 global pooling and an error for the vgg landmark pooling:
RuntimeError: shape '[1, 8, 2]' is invalid for input of size 1
I'll try to replicate the results on the test dataset but it's really frustrating trying to get a lot of these research papers to work in code. Half the time its poorly supported by the original authors and half the time its simply not reproducible. I really appreciate the authors work on this project and it is impressive for sure but as an MS Candidate in Artificial Intelligence and fellow scholar I really wish this library could be improved and I could understand some of the errors I'm getting or why I'm getting pretty bad predictions for the attributes.
Having been benefited from the authors efforts, very much appreciated in the first place. While frankly speaking, the quality of the code is kind of undermining the value of the work. Got similar experiences to @SikandAlex, running through all the fine classification recipes, and only vgg16+global worked out and gave stable results - other recipes gave unstable results between different runs and the results just look wrong. Do wish this code repo can be improved to a next level.
I get similar results to the above for the resnet50 global pooling and an error for the vgg landmark pooling:
RuntimeError: shape '[1, 8, 2]' is invalid for input of size 1
I also got the same error, may I know did you solve it in the end? Many thanks!
Hi Xia,
I solved the problem. You need to change the landmark tensor to shape of 16 instead of 8 in test_attr_predictor.py when using the roi model.
landmark_tensor = torch.zeros(16).view(1,-1)
Best, Karen
Baiqiang XIA @.***>于2022年2月9日 周三下午6:24写道:
I get similar results to the above for the resnet50 global pooling and an error for the vgg landmark pooling: RuntimeError: shape '[1, 8, 2]' is invalid for input of size 1
I also got the same error, may I know did you solve it in the end? Many thanks!
Hi, I tried many times but it was not fixable, so had to give up at the end. PS: [2020-wx] was my old account in Github.
— Reply to this email directly, view it on GitHub https://github.com/open-mmlab/mmfashion/issues/100#issuecomment-1033602092, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKTNYE24Z6NUE4TZGUOWE23U2I6GXANCNFSM4RZIWUSQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you commented.Message ID: @.***>
Created a new issue because #88 is poorly named
@ashisharora010 @veralauee
I have tried for a week straight to get this repository working and I'm still not having much luck.
Can't run coarse attribute prediction at all
Although the author's claimed 99% accuracy for Top-5 coarse attribute prediction I could not get that demo running at all. Other users have complained of bad predictions and the authors of this code instructed us to use the new Anno_fine data so I've abandoned coarse prediction for now.
See #99
Initial Setup for Fine Attribute Prediction
Download the new
Anno_fine
folder to use with model https://drive.google.com/drive/folders/19J-FY5NY7s91SiHpQQBo2ad3xjIB42iNFine Attributes VGG-16 Global Pooling (poor performance)
1) Download the VGG16 model from PyTorch
wget https://download.pytorch.org/models/vgg16-397923af.pth -O checkpoint/vgg16.pth
2) Download the pre-trained model from Category and Attribute Prediction (Fine) VGG16 Global Pooling from here
https://drive.google.com/file/d/10SZ3Lw4U0F9OKAuHWc-tBbvLS6yfE_x8/view?usp=sharing
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=10SZ3Lw4U0F9OKAuHWc-tBbvLS6yfE_x8' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=10SZ3Lw4U0F9OKAuHWc-tBbvLS6yfE_x8" -O finevgg16global.pth && rm -rf /tmp/cookies.txt
3) Prepare a test image
4) Get Predictions
python3 test_cate_attr_predictor.py --input floraltest.jpg --checkpoint ./finevgg16global.pth --config ../configs/category_attribute_predict/global_predictor_vgg.py
5) Output
6) Try another test image
7) Output
Fine Attributes VGG16 ROI Pooling (does not work at all)
1) Download the VGG16 model from PyTorch
wget https://download.pytorch.org/models/vgg16-397923af.pth -O checkpoint/vgg16.pth
2) Download the pre-trained model from Category and Attribute Prediction (Fine) VGG16 Landmark Pooling from here
https://drive.google.com/file/d/17XlihpZS9iY__i7rPxqlzpenHHRSbLGa/view
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=17XlihpZS9iY__i7rPxqlzpenHHRSbLGa' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=17XlihpZS9iY__i7rPxqlzpenHHRSbLGa" -O finevgg16landmark.pth && rm -rf /tmp/cookies.txt
3) Prepare a test image
4) Get Predictions
python3 test_cate_attr_predictor.py --input jeans.jpg --checkpoint ./finevgg16landmark.pth --config ../configs/category_attribute_predict/roi_predictor_vgg.py
5) Error / Output
Fine Attributes ResNet50 Global Pooling (does not work at all)
1) Download the ResNet50 model from PyTorch
wget https://download.pytorch.org/models/resnet50-19c8e357.pth -O checkpoint/resnet50.pth
2) Download the pre-trained model from Category and Attribute Prediction (Fine) ResNet50 Global Pooling from here
https://drive.google.com/file/d/1zsgxJAkdumpw4uDkapb1Ulq-aG1Hwz45/view
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1zsgxJAkdumpw4uDkapb1Ulq-aG1Hwz45' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1zsgxJAkdumpw4uDkapb1Ulq-aG1Hwz45" -O fineresnet50global.pth && rm -rf /tmp/cookies.txt
3) Prepare a test image
4) Get Predictions
python3 test_cate_attr_predictor.py --input jeans.jpg --checkpoint ./fineresnet50global.pth --config ../configs/category_attribute_predict/global_predictor_resnet.py
5) Error / Output
Fine Attributes ResNet50 Landmark Pooling (does not work at all)
1) Download the ResNet50 model from PyTorch
wget https://download.pytorch.org/models/resnet50-19c8e357.pth -O checkpoint/resnet50.pth
2) Download the pre-trained model from Category and Attribute Prediction (Fine) ResNet50 Landmark Pooling from here
https://drive.google.com/file/d/1zsgxJAkdumpw4uDkapb1Ulq-aG1Hwz45/view
Note
The ResNet Landmark Pooling / ResNet Global Pooling model links refer to the same file on https://github.com/open-mmlab/mmfashion/blob/master/docs/MODEL_ZOO.md (Not sure if this is an error by authors or not)
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1zsgxJAkdumpw4uDkapb1Ulq-aG1Hwz45' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1zsgxJAkdumpw4uDkapb1Ulq-aG1Hwz45" -O fineresnet50landmark.pth && rm -rf /tmp/cookies.txt
3) Prepare a test image
4) Get Predictions
python3 test_cate_attr_predictor.py --input jeans.jpg --checkpoint ./fineresnet50landmark.pth --config ../configs/category_attribute_predict/roi_predictor_resnet.py
5) Error / Output