mentian / object-deformnet

MIT License
121 stars 24 forks source link

No such file or directory: '../data/results/nocs_results/val/results_val_00000_0000.pkl' #8

Closed lhiceu closed 4 years ago

lhiceu commented 4 years ago

Hi, when I run pose_data.py to prepare datasets, I have the following problems: No such file or directory: '../data/results/nocs_results/val/results_val_00000_0000.pkl' I couldn't find the file download link either in readme.md or in the dataset.

lhiceu commented 4 years ago

I modified the path from ../data/results/nocs_results/val/ to ../data/gts/val/. Then I got another problem: Traceback (most recent call last): File "pose_data.py", line 384, in <module> annotate_test_data(data_dir) File "pose_data.py", line 311, in annotate_test_data gt_handle_visibility = nocs['gt_handle_visibility'] KeyError: 'gt_handle_visibility' I check the file results_val_00000_0000.pkl,its contents is as follows:

{'obj_list': ['/home/hewang/Projects/CoordRCNN/data/ShapeNetTOIModels/ShapeNetTOIFinalModels/val/03642806/fdec2b8af5dd988cef56c22fd326c67/model.obj', '/home/hewang/Projects/CoordRCNN/data/ShapeNetTOIModels/ShapeNetTOIFinalModels/val/03642806/fae8d4929159d0df7d14ad32b7473fd2/model.obj'], 'gt_scales': array([[0.52288 , 0.442578, 0.728506], [0.584684, 0.472236, 0.65965 ]], dtype=float32), 'gt_bboxes': array([[ 43, 419, 224, 582], [ 32, 14, 142, 214]], dtype=int32), 'image_id': 0, 'gt_class_ids': array([5, 5]), 'gt_RTs': array([[[ 0.40075716, -0.00969288, 0.07055298, 0.30217341], [-0.05753401, -0.28171718, 0.28810284, -0.19431935], [ 0.04197039, -0.29363149, -0.27874184, 0.97399586], [ 0. , 0. , 0. , 1. ]], [[-0.09787803, -0.01090088, 0.44777024, -0.37836784], [-0.32151401, -0.31739694, -0.07800668, -0.34349534], [ 0.3118425 , -0.33066216, 0.0601157 , 1.11896169], [ 0. , 0. , 0. , 1. ]]]), 'image_path': 'data/shapenet_toi_330K/val/00000/0000'}

mentian commented 4 years ago

There might be a bug here. I will try to fix it asap. Could you try to download the zip file with the link provided in "Section Evaluation of README", and change the path accordingly? The pre-processed results of NOCS is contained in this zip file.

lhiceu commented 4 years ago

Thanks for your reply. I didn't put the dataset under ./data, but I did set the internal file path according to README you provided. I modified the code at line 308 in ./preprocess/pose_data.py as follows: with open(nocs_path, 'rb') as f: nocs = cPickle.load(f) if 'handle_visibility' in nocs: gt_class_ids = nocs['gt_class_ids'] gt_bboxes = nocs['gt_bboxes'] gt_sRT = nocs['gt_RTs'] gt_handle_visibility = nocs['handle_visibility'] map_to_nocs = [] to filter resultsval{}_{}.pkl and results_realtest{}_{}.pkl. Is that fine?

lhiceu commented 4 years ago

Thank you again for your prompt reply Now when I run ./train_deform.py , I have another problem. Traceback (most recent call last): File "train_deform.py", line 10, in <module> from lib.loss import Loss File "/media/he/Disk/object-deformnet-master/lib/loss.py", line 4, in <module> from .nn_distance.chamfer_loss import ChamferLoss File "/media/he/Disk/object-deformnet-master/lib/nn_distance/chamfer_loss.py", line 2, in <module> import nn_distance ImportError: /home/he/.local/lib/python3.6/site-packages/nn_distance-0.0.0-py3.6-linux-x86_64.egg/nn_distance.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN3c105ErrorC1ENS_14SourceLocationERKSs Is it a compilation problem? Or something else? I have run: ROOT=/path/to/object-deformnet cd $ROOT/lib/nn_distance python setup.py install --user

mentian commented 4 years ago

(1) This part of code in my implementation is meant for copying the ground truth handle_visibility label. My code simplifies this step by directly copy it from the results of NOCS, which are originally obtained here. If you want to copy it from the original ground truth files provided in the dataset, there will be some data missing this information. You should also follow the above referred code and assign them to all ones. (2) It seems that your installation of nn_disance is not successful. If properly installed, *.so lib file should be there.

lhiceu commented 4 years ago

(1)I should copy the code below, right? if 'handle_visibility' in gt: result['gt_handle_visibility'] = gt['handle_visibility'] assert len(gt['handle_visibility']) == len(gt_class_ids) print('got handle visibiity.') else: result['gt_handle_visibility'] = np.ones_like(gt_class_ids) (2)I did: ldd -r nn_distance.cpython-36m-x86_64-linux-gnu.so c++filt symbol _ZN3c105ErrorC1ENS_14SourceLocationERKSs I got: symbol c10::Error::Error(c10::SourceLocation, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) I found the version of libtorch compiled is different from that of python of the exported model. Do I need to recompile myself? Is there any other good solution?

mentian commented 4 years ago

(1) Yes, your code should be correct. (2) Sorry that I am not sure how to solve this problem. I have not met this problem before. You might want to try your solution or tell me the environment in which you install nn_distance (as detailed as possible).

lhiceu commented 4 years ago

Thanks for your prompt reply. I haven't found a solution at the moment. This is my environment: deformnet.txt

mentian commented 4 years ago

I didn't see any problem in your environment. I use gcc-5.5.0 for compilation. My cudnn version is 7.1.4. But I do not think these are the problems. Could you search on the website for similar problem? For example, when I search for "_ZN3c105ErrorC1ENS_14SourceLocationERKSs", one of the suggested solutions is: "undefined symbol: _ZN3c105ErrorC1ENS_14SourceLocationERKSs: The std::string abi does not match between building PyTorch and its extensions. This is fixable by building extensions with -D_GLIBCXX_USE_CXX11_ABI=1 or building PyTorch from source (see this PyTorch thread)."

lhiceu commented 4 years ago

Thanks for your reply. I will continue to search for the solution. Could you please release the environment of the project in detail? Thanks.

mentian commented 4 years ago

How could I get the environment file as you provided?

lhiceu commented 4 years ago

I use conda conda env export > deformnet.yaml

mentian commented 4 years ago

I did not use conda. Is there another way of doing this?

lhiceu commented 4 years ago

I might solve the problem(2). The problem happens when I use conda environment. I found that nn_distance is always installed at /home/he/.local/lib/python3.6/site-packages/. There is no problem when I use ROOT environment.

lhiceu commented 4 years ago

I did not use conda. Is there another way of doing this?

Hi, you can use pip to output installed packages in requirements format. pip freeze > <catalogue>/requirements.txt