j96w / DenseFusion

"DenseFusion: 6D Object Pose Estimation by Iterative Dense Fusion" code repository
https://sites.google.com/view/densefusion
MIT License
1.1k stars 300 forks source link

Estimator returning NaN values on custom dataset, unable to match paper's result #192

Open ghost opened 3 years ago

ghost commented 3 years ago

I have a custom dataset that mimics the exact format of the Linemod dataset for all files/components. It is recorded with an Intel Realsense camera and consists of a single object. All data has been correctly converted to DenseFusion's requirements, including scaling object files, generating gt.yml and info.yml files, and editing appropriate scale/camera parameter values in dataset.py.

When training, the dataset is successfully loaded with dataset.py and begins training, completing an average of ten batches on the first epoch before returning 'nan' for Average Distance. This NaN value originates from the line in train.py ...

pred_r, pred_t, pred_c, emb = estimator(img, points, choose, idx)

Where all inputs to the function are verified to not contain any NaN entries. All returned variables are tensors of all NaNs. Additionally, the average distance when training starts is much larger than the original paper's -- a start of 50 or more compared to ~0.1 for the paper. What could be the source of large average distances and a return of NaN values from the estimator( ) function? The python tools when training an object from the original Linemod dataset work perfectly, but when training an object from the custom dataset present issues. Where can I look in my dataset to identify sources of this error? I feel that I have compared the two (custom data and original Linemod data) down to every single file requirement.

Additionally, where can I find documentation on the way gt.yml is formatted? Is the rotational transformation matrix listed as first/second/third row when written as a vector? What exact method was used to generate this information, rotational and translational (so that I may compare it with my own method)?

nihar0602 commented 3 years ago

Hi @Weathereds, thanks for your query. Were you able to figure this out? I wanted to know what approach you used to create a custom dataset. I'm also planning to do the same but I'm not sure where to start. Any help is appreciated. Thanks!

ghost commented 3 years ago

Hi @Weathereds, thanks for your query. Were you able to figure this out? I wanted to know what approach you used to create a custom dataset. I'm also planning to do the same but I'm not sure where to start. Any help is appreciated. Thanks!

@nihar0602 I am still in the process of validating whether or not my approach works in order to work with a custom dataset. If you would like general advice, my group is using an Intel Realsense Camera. There is another github project called ObjectDatasetTools that will allow you to create much of the data needed to mimic the Linemod dataset. It explains its own process well, and all resulting data must then be manually changed and renamed to mimic the linemod dataset exactly.

an99990 commented 2 years ago

hey @Weathereds any updates on your results ? did you figure it out ?