deep-fashion-retrieval
deep-fashion-retrieval copied to clipboard
kmeans.py: "ValueError: too many values to unpack"
Hello, thanks for devoloping your the deep-fashion-retrieval project. I need a little help for running your project.
I have following files:
DATASET_BASE +Anno +Eval +img +models: (only your model_10_final.pth.tar) +in_shop(optional) +list_bbox_inshop.txt +list_eval_partition.txt +img +all_feat.list(generated) +all_feat.npy(generated) +all_color_feat.npy(generated)
When I run the "python retrieval.py img/Sheer_Pleated-Front_Blouse/img_00000005.jpg", it is occuring following errors:
/usr/local/lib/python3.6/dist-packages/torchvision/transforms/transforms.py:188:
UserWarning: The use of the transforms.Scale transform is deprecated, please use transforms.Resize instead. "please use transforms.Resize instead.")
Loading model...
Loading model Done. Time: 4.231 sec
Loading feature database...
Loading feature database Done. Time: 0.738 sec
Extracting image feature...
Extracting image feature Done. Time: 0.480 sec
Loading feature K-means model...
Traceback (most recent call last): File "retrieval.py", line 147, in
clf = load_kmeans_model() File "/content/drive/My Drive/Deep_Learning/deep-fashion-retrieval/utils.py", line 110, in wrapped
ret = fn(*args, **kw) File "retrieval.py", line 45, in load_kmeans_model
clf = joblib.load(clf_model_path) File "/usr/local/lib/python3.6/dist-packages/sklearn/externals/joblib/numpy_pickle.py", line 590, in load
with open(filename, 'rb') as f: FileNotFoundError: [Errno 2] No such file or directory: 'DATASET_BASE/deepfashion_data/models/kmeans.m'
When I run the kmeans.py, it is occuring following errors:
/usr/local/lib/python3.6/dist-packages/torchvision/transforms/transforms.py:188:
UserWarning: The use of the transforms.Scale transform is deprecated, please use transforms.Resize instead. "please use transforms.Resize instead.")
Loading feature database...
Loading feature database Done. Time: 0.889 sec
Traceback (most recent call last):
File "kmeans.py", line 12, in
feats, labels = load_feat_db() ValueError: too many values to unpack (expected 2)
How to create kmeans.m? Or how to predict my special image? Thanks.
So, could you share your kmeans.m?
I've edited the kmeans.py line:12 "feats, labels = load_feat_db()" to "feats, colored_labels labels = load_feat_db()" the too many value rror resolved. And I run the following code: "python retrieval.py img/Sheer_Pleated-Front_Blouse/img_00000005.jpg" the result:
Loading model... Loading model Done. Time: 4.242 sec Loading feature database... Loading feature database Done. Time: 0.904 sec Extracting image feature... Extracting image feature Done. Time: 0.446 sec Loading feature K-means model... Loading feature K-means model Done. Time: 0.625 sec Doing naive query... Doing naive query Done. Time: 0.740 sec Doing query with k-Means... Doing query with k-Means Done. Time: 0.132 sec Naive query result: [ ('img/LEEF_PARIS_Abstract_Geo_Print_Tee/img_00000027.jpg', -9.451527907384863), ('img/Always_Be_Chic_Top/img_00000031.jpg', -9.514449859034473), ('img/Colorblocked_Hooded_Knit_Henley/img_00000043.jpg', -9.92034062512351), ('img/Must-Have_Ruched_Blazer/img_00000098.jpg', -9.982883641260077), ('img/WOMEN/Tees_Tanks/id_00006863/12_3_back.jpg', -10.022928339956696) ] K-Means query result: [ ('img/LEEF_PARIS_Abstract_Geo_Print_Tee/img_00000027.jpg', -9.451527907384863), ('img/Colorblocked_Hooded_Knit_Henley/img_00000043.jpg', -9.92034062512351), ('img/Gingham-Lined_Pocket_Tee/img_00000004.jpg', -10.113022974938781), ('img/Pintuck-Paneled_Blouse/img_00000046.jpg', -10.16232313787815), ('img/Classic_Crew_Neck_Tee/img_00000055.jpg', -10.163942529044464) ]
The prediction is soo wrong. How to increase accuracy?
Same issue here. Is there any improvement to it?