Perspective Transformer Nets train_ptn : IndexError
System information
- What is the top-level directory of the model you are using: /ptn
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow):NO
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04):Linux Ubuntu 16.04
- TensorFlow installed from (source or binary): conda install
- TensorFlow version (use command below):tensorflow-gpu==1.8.0
- Bazel version (if compiling from source): 0.5.2
- CUDA/cuDNN version:10.0/7.4
- GPU model and memory: 2080TI
- Exact command to reproduce:CUDA_VISIBLE_DEVICES=0 bazel-bin/train_ptn '--checkpoint_dir=/home/meeso/models/ptn/my_models/' '--inp_dir=/tmp/shapenet_tf/'
Describe the problem
when I run train_ptn,it got one error:
2019-01-06 14:13:22.378242: W tensorflow/core/framework/op_kernel.cc:1306] Unknown: exceptions.IndexError: arrays used as indices must be of integer (or boolean) type
Traceback (most recent call last):
File "/home/zh/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/script_ops.py", line 158, in call ret = func(*args)
File "/home/zh/ptn/model_ptn.py", line 132, in write_grid output_voxels=output_voxels)
File "/home/zh/ptn/model_ptn.py", line 218, in _build_image_grid utils.display_voxel(output_voxels[index, :, :, :, 0]), vis_size,
File "/home/zh/ptn/utils.py", line 69, in display_voxel data = visualize_voxel_spectral(points, vis_size)
File "/home/zh/ptn/utils.py", line 80, in visualize_voxel_spectral verts, faces = measure.marching_cubes_classic(points, 0, spacing=(0.1, 0.1, 0.1))
File "/home/zh/anaconda2/envs/tensorflow/lib/python2.7/site-packages/skimage/measure/_marching_cubes_classic.py", line 132, in marching_cubes_classic faces = _correct_mesh_orientation(volume, verts[faces], faces, spacing,
IndexError: arrays used as indices must be of integer (or boolean) type [[Node: PyFunc = PyFunc[Tin=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_INT64, DT_FLOAT, DT_FLOAT], Tout=[DT_UINT8], token="pyfunc_0", _device="/job:localhost/replica:0/task:0/device:CPU:0"](mul_3, ResizeNearestNeighbor, ResizeNearestNeighbor_1, global_step/read/_751, data_loading_shapenet_chair/val/batching_queues/shapenet_chair/val:1, decoder_1/Conv3d_transpose_2/Sigmoid/_753)]] [[Node: PyFunc/_1462 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_5196_PyFunc", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]]
Caused by op u'PyFunc', defined at:
File "/home/zh/ptn/bazel-bin/train_ptn.runfiles/main/train_ptn.py", line 230, in
@ZYCZH My guess is that the marching_cubes_classic API changes, so faces becomes empty or something.
File "/home/zh/ptn/utils.py", line 80, in visualize_voxel_spectral verts, faces = measure.marching_cubes_classic(points, 0, spacing=(0.1, 0.1, 0.1))
File "/home/zh/anaconda2/envs/tensorflow/lib/python2.7/site-packages/skimage/measure/_marching_cubes_classic.py", line 132, in marching_cubes_classic faces = _correct_mesh_orientation(volume, verts[faces], faces, spacing,
@ I have changed the version of scikit-image to 0.13.1, but it didn't work. And,the train went to model.ckpt-60, Then it interrupted. the same error: IndexError.
@ZYCZH我的猜测是marching_cubes_classic API发生了变化,因此face变为空或者其他东西。
文件“/home/zh/ptn/utils.py”,第80行,在visualize_voxel_spectral verts中,faces = measure.marching_cubes_classic(points,0,spacing =(0.1,0.1,0.1 ))
文件“/home/zh/anaconda2/envs/tensorflow/lib/python2.7/site-packages/skimage/measure/_marching_cubes_classic.py”,第132行,在marching_cubes_classic faces = _correct_mesh_orientation(volume,verts [faces],faces,间距,
And I check the API of marching_cubes_classic, It was OK.
@xcyan I don't know the reason. If it can train to get model.ckpt-60, why it can not continue to the end ?
Finally,I have to Comment the write_disk_grid,the train continued to the end . I think you are right ,the problem is ''marching_cubes_classic'',but I can not solve it. Thank you very much!.