image-matching-toolbox
image-matching-toolbox copied to clipboard
RuntimeError
RuntimeError: Tried to access nonexistent attribute or method 'call' of type 'torch.kornia.geometry.boxes.Boxes3D'. Did you forget to initialize an attribute in init()?: File "/home/szw/anaconda3/envs/image-matching-toolbox-main/lib/python3.7/site-packages/kornia/geometry/boxes.py", line 601 # Due to some torch.jit.script bug (at least <= 1.9), you need to pass all arguments to init when # constructing the class from inside of a method. return cls(hexahedrons, raise_if_not_floating_point=False, mode=mode) ~~~ <--- HERE
@zhubingerdai
Could you please provide the full command that leads to the error?
These instructions given in evaluation. md ,I tried every instruction
python -m immatch.eval_hpatches --gpu 0
--config 'superpoint' 'ncnet'
--task 'both' --save_npy
--root_dir .
@zhubingerdai
Sorry I can not reproduce your error again:
(immatch) zhouq@server:~/projects/image-matching-toolbox$ python -m immatch.eval_hpatches --gpu 0 --config 'superpoint' 'ncnet' --task 'both'
Can not import sparsencnet
>>>> Method=SuperPoint Default config: {'class': 'SuperPoint', 'keypoint_threshold': 0.005, 'nms_radius': 4, 'max_keypoints': -1, 'match_threshold': 0.0, 'imsize': -1} Thres: [0.0]
Loaded SuperPoint model
Initialize SuperPoint_r4
Matching thres: 0.0 Save to: None
>>>>Eval hpatches: task=matching+homography method=SuperPoint_r4 scale_H=False rthres=2 thres=[1, 3, 5,10]
7%|████▉ | 8/108 [00:03<00:43, 2.31it/s]
What's your Konria version?
Konria version:0.6.5
I tried with the same version, I can not reproduce the bug. I am afraid that you will need to locate the cause of the error first then I can update the repo. But so far I did not find this bug in my environment.
@zhubingerdai @GrumpyZhou I had the same problem, but was able to resolve it by forcing kornia to an earlier version (e.g. kornia==0.4.1
in setup.py
).
According to https://github.com/kornia/kornia/issues/1555#issuecomment-1028709367, Kornia recently established a min pytorch version of 1.8.1 (I think in release 0.6.0 - see release note here?). Your install.md
says that you tested with pytorch=1.7.0, so this may be causing the problem? I just chose kornia==0.4.1
because it was the latest release when you created the image-matching-toolbox repo (Nov 24, 2020) but anything < 0.6.0 might work.
Unrelated, but @GrumpyZhou you were also missing a dependency on pydegensac
in setup.py
. I can submit a pull request for these two changes, if you'd like!
@arjunkarpur Hi, Thanks! Actually, I am considering migrating the toolbox to work on a newer version of pytorch. But will do this when I have free time so not exact time schedule for now. I will also add pydegensac dependency.
@GrumpyZhou cool no problem. I might also suggest upgrading CUDA to 11.0 😁
I think pytorch isn't compatible with CUDA 11.2 and tf2 isn't compatible with CUDA 11.1, so I had to change cudatoolkit=11.0
in environment.yml
to make it compatible with both (I use tf2 in my own custom modules)