learning3d icon indicating copy to clipboard operation
learning3d copied to clipboard

cannot import name 'ChamferDistanceLoss' from 'learning3d.losses

Open 01yaoyuan opened this issue 2 years ago • 5 comments

image hello,while I run pcrnet_train.py in my virtual python environmnent outside learning3d ,I come across a question shown in this picture,I sincerly hope you help with me to slove this question

01yaoyuan avatar Apr 06 '23 15:04 01yaoyuan

Hi @01yaoyuan , I have tested the code on my side for test_pcrnet.py. It seems to be working totally fine on my personal system. Following is the screenshot showing the code's working. Along with that adding one more image of registered point cloud.

Screenshot from 2023-06-11 01-20-03

Screenshot from 2023-06-11 01-20-14

vinits5 avatar Jun 10 '23 19:06 vinits5

I just tried with command "python test_pcrnet.py -b 1" in my virtual python environment ,but get result as shown in the picture.Maybe some library is not compatible with my system.So could you tell me more retailed information about the library in your virtual environment. I install library in my virtual envirommetn by requirements.txt.Thank you very much.

 

yaoyuan @.***

Original Email

Sender:"ViNiT SaRoDe"< @.*** >;

Sent Time:2023/6/11 3:52

To:"vinits5/learning3d"< @.*** >;

Cc recipient:"01yaoyuan"< @.*** >;"Mention"< @.*** >;

Subject:Re: [vinits5/learning3d] cannot import name 'ChamferDistanceLoss'from 'learning3d.losses (Issue #19)

Hi @01yaoyuan , I have tested the code on my side for test_pcrnet.py. It seems to be working totally fine on my personal system. Following is the screenshot showing the code's working. Along with that adding one more image of registered point cloud.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

01yaoyuan avatar Jun 11 '23 01:06 01yaoyuan

Hey @01yaoyuan, I have recently updated the requirements.txt file (Link: https://github.com/vinits5/learning3d/blob/master/requirements.txt) with the latest versions that I have in the conda environment that I use. Also, I am running the code on a non-GPU system. If you are using a GPU based system then please let me know. It might be the issue with CUDA compatibility for a faster and cuda based implementation of chamfer distance loss function.

Just a suggestion, maybe you can try to run test_pcrnet.py file by commenting the code from line number 35 to line no. 41 and correct the indentation for line number 42 in this file (Link: https://github.com/vinits5/learning3d/blob/master/losses/chamfer_distance.py#L35). If by doing so makes the code work then we will be sure that the issue is with CUDA based implementation of chamfer distance loss function.

Otherwise, we can e-meet on google meet and resolve this problem together. Thanks.

vinits5 avatar Jun 11 '23 12:06 vinits5

Thank you very much.I will test it on gpu system torromow.And I will record erros I have meeted,I will send to you after a few days.Thank you for you reply again,keep in touch

yaoyuan @.***

 

------------------ 原始邮件 ------------------ 发件人: "vinits5/learning3d" @.>; 发送时间: 2023年6月11日(星期天) 晚上8:47 @.>; @.@.>; 主题: Re: [vinits5/learning3d] cannot import name 'ChamferDistanceLoss' from 'learning3d.losses (Issue #19)

Hey @01yaoyuan, I have recently updated the requirements.txt file (Link: https://github.com/vinits5/learning3d/blob/master/requirements.txt) with the latest versions that I have in the conda environment that I use. Also, I am running the code on a non-GPU system. If you are using a GPU based system then please let me know. It might be the issue with CUDA compatibility for a faster and cuda based implementation of chamfer distance loss function.

Just a suggestion, maybe you can try to run test_pcrnet.py file by commenting the code from line number 35 to line no. 41 and correct the indentation for line number 42 in this file (Link: https://github.com/vinits5/learning3d/blob/master/losses/chamfer_distance.py#L35). If by doing so makes the code work then we will be sure that the issue is with CUDA based implementation of chamfer distance loss function.

Otherwise, we can e-meet on google meet and resolve this problem together. Thanks.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

01yaoyuan avatar Jun 11 '23 14:06 01yaoyuan

I just wanted to add a comment about this chamfer loss implementation--it's very short and elegant, which is great for interpretability, but unfortunately it's also very slow. You may want to consider switching to a different chamfer loss implementation, particularly since this is likely to be called every iteration in some models. For example, the Kaolin chamfer distance implementation is roughly 10x faster.

BotScutters avatar Apr 23 '24 17:04 BotScutters