You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
conda create -n deep-hawkeye python=3.6
conda activate deep-hawkeye
pip install opencv-python scipy
# pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html# command above is broken, used following instead ( provided by PyTorch website: https://pytorch.org/get-started/previous-versions/ )
conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge
# conda install -c pytorch faiss-gpu cudatoolkit=10.2# command above is broken too, used following instead ( provided by Anaconda package search results: https://anaconda.org/conda-forge/faiss-gpu )
conda install -c conda-forge faiss-gpu
# try to start training
python demo_train.py -d "./workdir/demo_data/grid/normal_data" -c "grid" --batch_size=64 --weight_path="./workdir/wide_r50_2.pth" --normal_feature_save_path="./workdir/export_pth" --model_device="cuda:0" --max_cluster_image_num=1000 --index_build_device=-1
Then comes a TypeError:
Traceback (most recent call last):
File "demo_train.py", line 42, in <module>
gen_lib(train_img_path, cls)
File "demo_train.py", line 33, in __call__
self.train_model.train()
File "T:\Projects\DeepHawkeye\src\train.py", line 105, in train
np.arange(0, seg_batch_size),
File "C:\Users\firok\.conda\envs\deep-hawkeye\lib\site-packages\faiss\__init__.py", line 112, in replacement_add_with_ids
self.add_with_ids_c(n, swig_ptr(x), swig_ptr(ids))
File "C:\Users\firok\.conda\envs\deep-hawkeye\lib\site-packages\faiss\swigfaiss_avx2.py", line 3898, in add_with_ids
return _swigfaiss_avx2.IndexIVFPQ_add_with_ids(self, n, x, xids)
TypeError: Wrong number or type of arguments for overloaded function 'IndexIVFPQ_add_with_ids'.
Possible C/C++ prototypes are:
faiss::IndexIVFPQ::add_with_ids(faiss::Index::idx_t,float const *,faiss::Index::idx_t const *)
faiss::IndexIVFPQ::add_with_ids(faiss::Index::idx_t,float const *)
# BTW, parameter type conversion code missed several type declarations and would cause TypeError.# Here is the fixdefget_train_args():
parser=argparse.ArgumentParser()
parser.add_argument('-d','--total_img_paths', type=str, default=None)
parser.add_argument('-c','--category', type=str, default=None, help='category of sample')
parser.add_argument('--batch_size', default=64, type=int)
parser.add_argument('--embedding_layers', choices=['1_2', '2_3'], default='2_3')
parser.add_argument('--input_size', default=(224, 224))
parser.add_argument('--weight_path', default='./weights/wide_r50_2.pth')
parser.add_argument('--normal_feature_save_path', default=f"./index_lib")
parser.add_argument('--model_device', default="cuda:0")
parser.add_argument('--max_cluster_image_num', default=1000, type=int, help='depend on CPU memory, more than total images number')
parser.add_argument('--index_build_device', default=-1, type=int, help='CPU:-1 ,GPU number eg: 0, 1, 2 (only on Linux)')
The text was updated successfully, but these errors were encountered:
Reproduce steps:
Then comes a TypeError:
Environment:
Win x64 22H2
The text was updated successfully, but these errors were encountered: