Closed bharadwajdhornala closed 4 years ago
Hi, @bharadwajdhornala. The main compatibility problem is that the version provided by tf_nndistance, namely Chamfer Loss, is the GPU version. If you want to use it on CPU, you need to use Chamfer Loss of CPU version. I will upload the Loss code of CPU version to the external/tf_nndistance_cpu.py
, please import this library.
Can you upload the tf_nndistance_cpu_so.so file so that I can continue my further execution. Or can you please guide for the demo.py execution using CPU.
I got an error in the below File "/home/bharadwaj/Pixel2MeshPlusPlus/external/tf_nndistance_cpu.py", line 17, in nn_distance_cpu pc1_expand_tile = tf.tile(tf.expand_dims(pc1,2), [1,1,M,1]) TypeError: Failed to convert object of type <class 'list'> to Tensor. Contents: [1, 1, None, 1]. Consider casting elements to a supported type.
Please suggest.
Hi @bharadwajdhornala , tf_nndistance_cpu.py
do not require compile. I think and the error may related to unknown tensor shape for placeholder, so I have modified the code of cpu version chamfer loss. For now, you do not need to expand dimension of batch_size
before calling loss function, and it also should fix the bug of None
tensor size.
Do let me know if you have any other questions.
Thanks @walsvid , When I run the code, I got this error pc1_expand_tile = tf.tile(tf.expand_dims(pc1,2), [1,1,M,1]) ValueError: Shape must be rank 5 but is rank 4 for 'Tile' (op: 'Tile') with input shapes: [1,1,1,?,3], [4]. So, I have tried to increase rank 4 to 5,and it worked, it gave an obj file. But when I run it another time , its getting Killed. If I want to replace plane images with any other images, should I change the cameras.txt also?
That may related to unnecessary expan dims, may be after compute the CPU version chamfer, you should squeeze or reshape the tensor to remove the unnecessary dimensions.
Yes, if the images changed the camera parameter should also be changed. All the camera data are provided for shapenet.
Can you please upload the changes to be made in chamfer for reshaping tensor.
I mean you should check your code for extra expand dimension operations to make sure the output is correct. At present, we can only guarantee that the GPU version is definitely correct. Whether there is bugs with the CPU version, you need to check it by yourself first. I will check it later when I have time.
Thanks @walsvid for your valuable suggestions.
I am using Python 3.6, TensorFlow 1.12.0 on Ubuntu 16.04. I have installed all the requirements accordingly except CUDA. I want to to test this code. I get this error when I run it. Traceback (most recent call last): File "demo.py", line 12, in
from modules.models_mvp2m import MeshNetMVP2M as MVP2MNet
File "/home/bharadwaj/Pixel2MeshPlusPlus/modules/models_mvp2m.py", line 9, in
from modules.losses import mesh_loss, laplace_loss
File "/home/bharadwaj/Pixel2MeshPlusPlus/modules/losses.py", line 6, in
from modules.chamfer import nn_distance
File "/home/bharadwaj/Pixel2MeshPlusPlus/modules/chamfer.py", line 4, in
nn_distance_module = tf.load_op_library('./external/tf_nndistance_so.so')
File "/home/bharadwaj/anaconda3/envs/Pixel2Mesh++/lib/python3.6/site-packages/tensorflow/python/framework/load_library.py", line 60, in load_op_library
lib_handle = py_tf.TF_LoadLibrary(library_filename)
tensorflow.python.framework.errors_impl.NotFoundError: libcudart.so.9.0: cannot open shared object file: No such file or directory
Can this code be made compatible for CPU? What are the changes to be made to it CPU compatible. Thanks in advance.