meetps / tf-3dgan

Tensorflow implementation of 3D Generative Adversarial Network.
https://meetshah.dev/gan/deep-learning/tensorflow/visdom/2017/04/01/3d-generative-adverserial-networks-for-volume-classification-and-generation.html
MIT License
284 stars 79 forks source link

Testing Error #30

Open Ajithbalakrishnan opened 5 years ago

Ajithbalakrishnan commented 5 years ago

Hi Meetshah, I have t=done training . But during testing i got some errors.please go through the errors

(Gan_tf_Ajith) gpu@gpu:~/Desktop/Ajith Balakrishnan/3D Gan/tf-3dgan-master/src$ python 3dgan_mit_biasfree.py 1 ./models/biasfree_360.cptk All dependencies not loaded, some functionality may not work

WARNING: The TensorFlow contrib module will not be included in TensorFlow 2.0. For more information, please see:

WARNING:tensorflow:From /home/gpu/anaconda3/envs/Gan_tf_Ajith/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version. Instructions for updating: Colocations handled automatically by placer. Tensor("gen/Relu:0", shape=(32, 4, 4, 4, 512), dtype=float32) Tensor("gen/Relu_1:0", shape=(32, 8, 8, 8, 256), dtype=float32) Tensor("gen/Relu_2:0", shape=(32, 16, 16, 16, 128), dtype=float32) Tensor("gen/Relu_3:0", shape=(32, 32, 32, 32, 64), dtype=float32) Tensor("gen/Tanh:0", shape=(32, 64, 64, 64, 1), dtype=float32) Tensor("gen_1/Relu:0", shape=(32, 4, 4, 4, 512), dtype=float32) Tensor("gen_1/Relu_1:0", shape=(32, 8, 8, 8, 256), dtype=float32) Tensor("gen_1/Relu_2:0", shape=(32, 16, 16, 16, 128), dtype=float32) Tensor("gen_1/Relu_3:0", shape=(32, 32, 32, 32, 64), dtype=float32) Tensor("gen_1/Tanh:0", shape=(32, 64, 64, 64, 1), dtype=float32) WARNING:root:Setting up a new session... 2019-04-03 14:48:12.744862: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2019-04-03 14:48:12.776387: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2793445000 Hz 2019-04-03 14:48:12.776740: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x560e4a86a990 executing computations on platform Host. Devices: 2019-04-03 14:48:12.776883: I tensorflow/compiler/xla/service/service.cc:158] StreamExecutor device (0): , WARNING:tensorflow:From /home/gpu/anaconda3/envs/Gan_tf_Ajith/lib/python3.5/site-packages/tensorflow/python/training/saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version. Instructions for updating: Use standard file APIs to check for files with this prefix. WARNING:tensorflow:From /home/gpu/anaconda3/envs/Gan_tf_Ajith/lib/python3.5/site-packages/tensorflow/python/training/saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version. Instructions for updating: Use standard file APIs to check for files with this prefix. 1.0000001 -0.9996578 (64, 64, 64, 1) Traceback (most recent call last): File "3dgan_mit_biasfree.py", line 267, in testGAN(trained_model_path=path) File "3dgan_mit_biasfree.py", line 261, in testGAN d.plotVoxelVisdom(np.squeeze(g_objects[idch[i]]>0.5), vis, ''.join(map(str,[i]))) File "/home/gpu/Desktop/Ajith Balakrishnan/3D Gan/tf-3dgan-master/src/dataIO.py", line 59, in plotVoxelVisdom v, f = getVFByMarchingCubes(voxels) File "/home/gpu/Desktop/Ajith Balakrishnan/3D Gan/tf-3dgan-master/src/dataIO.py", line 51, in getVFByMarchingCubes v, f = sk.marching_cubes_lewiner(voxels, level=threshold) ValueError: too many values to unpack (expected 2) (Gan_tf_Ajith) gpu@gpu:~/Desktop/Ajith Balakrishnan/3D Gan/tf-3dgan-master/src$ python 3dgan_mit_biasfree.py 1 ./models/biasfree_360.cptk All dependencies not loaded, some functionality may not work

WARNING: The TensorFlow contrib module will not be included in TensorFlow 2.0. For more information, please see:

WARNING:tensorflow:From /home/gpu/anaconda3/envs/Gan_tf_Ajith/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version. Instructions for updating: Colocations handled automatically by placer. Tensor("gen/Relu:0", shape=(32, 4, 4, 4, 512), dtype=float32) Tensor("gen/Relu_1:0", shape=(32, 8, 8, 8, 256), dtype=float32) Tensor("gen/Relu_2:0", shape=(32, 16, 16, 16, 128), dtype=float32) Tensor("gen/Relu_3:0", shape=(32, 32, 32, 32, 64), dtype=float32) Tensor("gen/Tanh:0", shape=(32, 64, 64, 64, 1), dtype=float32) Tensor("gen_1/Relu:0", shape=(32, 4, 4, 4, 512), dtype=float32) Tensor("gen_1/Relu_1:0", shape=(32, 8, 8, 8, 256), dtype=float32) Tensor("gen_1/Relu_2:0", shape=(32, 16, 16, 16, 128), dtype=float32) Tensor("gen_1/Relu_3:0", shape=(32, 32, 32, 32, 64), dtype=float32) Tensor("gen_1/Tanh:0", shape=(32, 64, 64, 64, 1), dtype=float32) WARNING:root:Setting up a new session... 2019-04-03 15:29:01.315127: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2019-04-03 15:29:01.340357: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2793445000 Hz 2019-04-03 15:29:01.340741: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x5582206169a0 executing computations on platform Host. Devices: 2019-04-03 15:29:01.340782: I tensorflow/compiler/xla/service/service.cc:158] StreamExecutor device (0): , WARNING:tensorflow:From /home/gpu/anaconda3/envs/Gan_tf_Ajith/lib/python3.5/site-packages/tensorflow/python/training/saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version. Instructions for updating: Use standard file APIs to check for files with this prefix. WARNING:tensorflow:From /home/gpu/anaconda3/envs/Gan_tf_Ajith/lib/python3.5/site-packages/tensorflow/python/training/saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version. Instructions for updating: Use standard file APIs to check for files with this prefix. 1.0 -0.99949867 (64, 64, 64, 1) Traceback (most recent call last): File "3dgan_mit_biasfree.py", line 267, in testGAN(trained_model_path=path) File "3dgan_mit_biasfree.py", line 261, in testGAN d.plotVoxelVisdom(np.squeeze(g_objects[idch[i]]>0.5), vis, ''.join(map(str,[i]))) File "/home/gpu/Desktop/Ajith Balakrishnan/3D Gan/tf-3dgan-master/src/dataIO.py", line 59, in plotVoxelVisdom v, f = getVFByMarchingCubes(voxels) File "/home/gpu/Desktop/Ajith Balakrishnan/3D Gan/tf-3dgan-master/src/dataIO.py", line 51, in getVFByMarchingCubes v, f = sk.marching_cubes_lewiner(voxels, level=threshold) ValueError: too many values to unpack (expected 2) (Gan_tf_Ajith) gpu@gpu:~/Desktop/Ajith Balakrishnan/3D Gan/tf-3dgan-master/src$

Ajithbalakrishnan commented 5 years ago

One more issue is that , the use of the below line next_sigma = float(raw_input()) ------please see 3dgan_mit_biasfree.py

It shows error as raw_input() is not defined.

Ajithbalakrishnan commented 5 years ago

Meetshah , I got some idea about Value error . Its simply due to mismatching of return values of sk.marching_cubes_lewiner(voxels,level=threshold) function.

It gives 4 return variables . But on left hand side only 2 variables are there. In marching_cubes_lewiner documentation they gives details about return variables as given below. Returns

verts(V, 3) array

    Spatial coordinates for V unique mesh vertices. Coordinate order matches input volume (M, N, P).
faces(F, 3) array

    Define triangular faces via referencing vertex indices from verts. This algorithm specifically outputs triangles, so each face has exactly three indices.
normals(V, 3) array

    The normal direction at each vertex, as calculated from the data.
values(V, ) array

    Gives a measure for the maximum value of the data in the local region near each vertex. This can be used by visualization tools to apply a colormap to the mesh.

Please tell me which one i have to choose.

Ajithbalakrishnan commented 5 years ago

Hi Meershah, i took verts(V, 3) array, and faces(F, 3) array . testing starts working. Output was like

1.0000001 -0.99938345 (64, 64, 64, 1)

1.0000001 -0.9997308 (64, 64, 64, 1)

1.0000001 -0.99984795 (64, 64, 64, 1)

1.0000001 -0.99959624 (64, 64, 64, 1)

But i ddin't get how can i see the output in graphical form. Command promt code is shown below (Gan_tf_Ajith) gpu@gpu:~/Desktop/Ajith Balakrishnan/3D Gan/tf-3dgan-master/src$ python 3dgan_mit_biasfree.py 1 ./models/biasfree_360.cptk All dependencies not loaded, some functionality may not work

WARNING: The TensorFlow contrib module will not be included in TensorFlow 2.0. For more information, please see:

WARNING:tensorflow:From /home/gpu/anaconda3/envs/Gan_tf_Ajith/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version. Instructions for updating: Colocations handled automatically by placer. Tensor("gen/Relu:0", shape=(32, 4, 4, 4, 512), dtype=float32) Tensor("gen/Relu_1:0", shape=(32, 8, 8, 8, 256), dtype=float32) Tensor("gen/Relu_2:0", shape=(32, 16, 16, 16, 128), dtype=float32) Tensor("gen/Relu_3:0", shape=(32, 32, 32, 32, 64), dtype=float32) Tensor("gen/Tanh:0", shape=(32, 64, 64, 64, 1), dtype=float32) Tensor("gen_1/Relu:0", shape=(32, 4, 4, 4, 512), dtype=float32) Tensor("gen_1/Relu_1:0", shape=(32, 8, 8, 8, 256), dtype=float32) Tensor("gen_1/Relu_2:0", shape=(32, 16, 16, 16, 128), dtype=float32) Tensor("gen_1/Relu_3:0", shape=(32, 32, 32, 32, 64), dtype=float32) Tensor("gen_1/Tanh:0", shape=(32, 64, 64, 64, 1), dtype=float32) WARNING:root:Setting up a new session... 2019-04-03 16:23:31.310728: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2019-04-03 16:23:31.468435: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2793445000 Hz 2019-04-03 16:23:31.473110: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x56499066f260 executing computations on platform Host. Devices: 2019-04-03 16:23:31.473161: I tensorflow/compiler/xla/service/service.cc:158] StreamExecutor device (0): , WARNING:tensorflow:From /home/gpu/anaconda3/envs/Gan_tf_Ajith/lib/python3.5/site-packages/tensorflow/python/training/saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version. Instructions for updating: Use standard file APIs to check for files with this prefix. WARNING:tensorflow:From /home/gpu/anaconda3/envs/Gan_tf_Ajith/lib/python3.5/site-packages/tensorflow/python/training/saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version. Instructions for updating: Use standard file APIs to check for files with this prefix. 2019-04-03 16:23:34.389841: W tensorflow/core/framework/allocator.cc:124] Allocation of 67108864 exceeds 10% of system memory. 2019-04-03 16:23:36.241176: W tensorflow/core/framework/allocator.cc:124] Allocation of 67108864 exceeds 10% of system memory. 2019-04-03 16:23:36.292676: W tensorflow/core/framework/allocator.cc:124] Allocation of 268435456 exceeds 10% of system memory. 2019-04-03 16:23:36.292743: W tensorflow/core/framework/allocator.cc:124] Allocation of 67108864 exceeds 10% of system memory. 2019-04-03 16:23:40.452937: W tensorflow/core/framework/allocator.cc:124] Allocation of 268435456 exceeds 10% of system memory. 1.0000001 -0.9998453 (64, 64, 64, 1) 4 1.0000001 -0.99958307 (64, 64, 64, 1) 4 1.0000001 -0.99965256 (64, 64, 64, 1) 4 1.0000001 -0.9998076 (64, 64, 64, 1) 4 1.0000001 -0.999652 (64, 64, 64, 1) 4 1.0000001 -0.99975055 (64, 64, 64, 1)

DJxuelei commented 4 years ago

Hi, I meet the same question,but i slove it by replace the code "v, f = sk.marchingcubes(voxels, level=threshold)" with"v, f , _ = sk.marching_cubes_lewiner(voxels, level=threshold)",because I see the reason in here https://scikit-image.org/docs/stable/auto_examples/edges/plot_marching_cubes.html. the function marching_cubes() return four value indeed!!