Closed lkf1996 closed 4 years ago
Hi, @lkf1996 Could you give more complete information such as the output of error messages and the version environment of the program you are using?
嗨,@ lkf1996您能否提供更完整的信息,例如错误消息的输出以及所使用程序的版本环境?
Thanks for ur reply , I used 2080ti, tensorflow-gpu 1.12.0, CUDA 9.0, cudnn7.3 to reproduce the code test part, but I encountered a bug in the middle. I found that the reason was that running on 2080ti would crash, so I used CPU to reproduce . but the new error occured. `020-07-25 08:19:36.773742: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:198] kernel reported version is: 430.50.0 2020-07-25 08:19:36.773749: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:305] kernel version seems to match DSO: 430.50.0 => start train stage 1 Traceback (most recent call last): File "/home/zhaolei/.conda/envs/tensorflow-1.13.1/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1334, in _do_call return fn(*args) File "/home/zhaolei/.conda/envs/tensorflow-1.13.1/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1319, in _run_fn options, feed_dict, fetch_list, target_list, run_metadata) File "/home/zhaolei/.conda/envs/tensorflow-1.13.1/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1407, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.InvalidArgumentError: indices[0,7] = -1 is not in [0, 157) [[{{node GatherV2_21}} = GatherV2[Taxis=DT_INT32, Tindices=DT_INT32, Tparams=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"](concat_5, strided_slice_27, gradients/graph_proj_3_layer_31/Max_grad/mod)]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/zhaolei/tensorflow_code/Pixel2MeshPlusPlus-master/train_mvp2m.py", line 141, in
Caused by op 'GatherV2_21', defined at:
File "/home/zhaolei/tensorflow_code/Pixel2MeshPlusPlus-master/train_mvp2m.py", line 141, in
InvalidArgumentError (see above for traceback): indices[0,7] = -1 is not in [0, 157) [[node GatherV2_21 (defined at /home/zhaolei/tensorflow_code/Pixel2MeshPlusPlus-master/modules/losses.py:19) = GatherV2[Taxis=DT_INT32, Tindices=DT_INT32, Tparams=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"](concat_5, strided_slice_27, gradients/graph_proj_3_layer_31/Max_grad/mod)]]
`
I had take much time to solve it , I will appreciate it if you can help me.
Hi, @lkf1996 Could you give more complete information such as the output of error messages and the version environment of the program you are using?
In losses.py , when def laplace_coord , the code"laplace = tf.reduce_sum(tf.gather(vertex,indices),1)," There is "-1" in indices(lape_idx) . But It's not even running here, it has reported an error
It seems that you use tensorflow-1.13.1/
. Anyway, after I check the code I think this issue is due to the API change of tensorflow. During the time we build this model, tf.gather
can take -1
as index, however it change to [0, maxindex) now.
Luckily, the solution is not hard. After read the pickle file in https://github.com/walsvid/Pixel2MeshPlusPlus/blob/master/utils/tools.py#L14 , you need to add some code to change the index -1 to the last positive index of each block. Since we have 156, 618, 2466 vertices in 3 blocks. So we can change -1 to 156, 618, 2466 respectively.
The minimal code added are as follows:
lape_idx[0][lape_idx[0] == -1] = 156
lape_idx[1][lape_idx[0] == -1] = 618
lape_idx[2][lape_idx[0] == -1] = 2466
看来您使用了
tensorflow-1.13.1/
。无论如何,在检查代码后,我认为此问题是由于tensorflow的API更改所致。在我们构建此模型的过程中,tf.gather
可以将其-1
作为索引,但是现在更改为[0,maxindex)。幸运的是,解决方案并不难。 读取https://github.com/walsvid/Pixel2MeshPlusPlus/blob/master/utils/tools.py#L14中的pickle文件后,您需要添加一些代码以将索引-1更改为每个块的最后一个正索引。由于我们在3个块中有156、618、2466个顶点。因此我们可以将-1分别更改为156、618、2466。
添加的最少代码如下:
lape_idx[0][lape_idx[0] == -1] = 156 lape_idx[1][lape_idx[0] == -1] = 618 lape_idx[2][lape_idx[0] == -1] = 2466
thanks. I had resolved it by change the "-1" to "0"
看来您使用了
tensorflow-1.13.1/
。无论如何,在检查代码后,我认为此问题是由于tensorflow的API更改所致。在我们构建此模型的过程中,tf.gather
可以将其-1
作为索引,但是现在更改为[0,maxindex)。幸运的是,解决方案并不难。 读取https://github.com/walsvid/Pixel2MeshPlusPlus/blob/master/utils/tools.py#L14中的pickle文件后,您需要添加一些代码以将索引-1更改为每个块的最后一个正索引。由于我们在3个块中有156、618、2466个顶点。因此我们可以将-1分别更改为156、618、2466。
添加的最少代码如下:
lape_idx[0][lape_idx[0] == -1] = 156 lape_idx[1][lape_idx[0] == -1] = 618 lape_idx[2][lape_idx[0] == -1] = 2466
Excuse me? I firstly read the code about “Pixel2mesh” , I found a file named “GenerateData” , but it does not apply to this code . Can you share the new way to generatedata? because I want to train my own dataset. Thanks for the trouble.
Hi, @lkf1996 . We use the same method to generate data. All the generate data code have been upload to pixel2mesh repo.
thanks. I had resolved it by change the "-1" to "0"
I don't think change to 0 is correct, you should change to the max index of each stage. 0 is the 1st vertices, and -1 is the dummy vertex for padding which is the 156th, 618th and 2466th vertex in 3 stages.
thanks. I had resolved it by change the "-1" to "0"
I don't think change to 0 is correct, you should change to the max index of each stage. 0 is the 1st vertices, and -1 is the dummy vertex for padding which is the 156th, 618th and 2466th vertex in 3 stages.
Thank you for your reply. I added the 0 vector to the first column and the value of indices by adding "1", so as to avoid the error of "-1". Thank you for your guidance Still on the data issue, I found that "Pixel2Mesh_aux_4Works.dat" and "PIXel2Mesh ++" in the folder "PIXel2Mesh ++" cannot be read in the same way, and "ICCV_P2mpp.dat" has added "faces_triangle", "sample_coord" and "sample_adj" to the data. If it's not the data, what's the problem?
Hi, @lkf1996 .
Pixel2Mesh_aux_4Works.dat
add 4th stage to explain how to prepare data for mesh unpooling which is not used in P2M++faces_triangle
is actually not used in P2M and P2M++sample_coord
and sample_adj
is used for Hypothesis Sampling in our paper, the sampled coord and its adjacency is fixed constant is our implementation.Hi, @lkf1996 .
Pixel2Mesh_aux_4Works.dat
add 4th stage to explain how to prepare data for mesh unpooling which is not used in P2M++faces_triangle
is actually not used in P2M and P2M++sample_coord
andsample_adj
is used for Hypothesis Sampling in our paper, the sampled coord and its adjacency is fixed constant is our implementation.
thank you for your reply. May I ask what graphics card you use to run this program? I used 2080RTX and had the same problem as the previous one. He used 2080Ti. None of us could run this program under GPU, otherwise the following problems would occur. The following is the link of issue. https://github.com/walsvid/Pixel2MeshPlusPlus/issues/10#issue-640106275
We use TitanXp or 1080Ti with CUDA9
I think it should be like this:
lape_idx[0][lape_idx[0] == -1] = 156
lape_idx[1][lape_idx[1] == -1] = 618
lape_idx[2][lape_idx[2] == -1] = 2466
hello! Have you run the train.py successfully? I got a problem "InvalidArgumenrError : indices[0,7]= -1 is nor in [0,157] " when run in "sess.run(model , feed_dict = feed_dict" .
The train data is loaded in this github , It has upset me for many days .
Hope for your reply ``