carpedm20 / DCGAN-tensorflow

A tensorflow implementation of "Deep Convolutional Generative Adversarial Networks"
http://carpedm20.github.io/faces/
MIT License
7.15k stars 2.63k forks source link

why I have This problem #57

Closed myw8 closed 7 years ago

myw8 commented 7 years ago

Sorry to bother you I have this problem few days and still can not find a solution . my tensorflow 0.11 I run python main.py --dataset mnist --is_train True , this problem occurs: ValueError: Variable g_bn0/g_bn0_2/g_bn0_2/moments_1/moments_1/mean/ExponentialMovingAverage/biased does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=None in VarScope? can you help me thank you

myw8 commented 7 years ago

ld@ld-To-be-filled-by-O-E-M:~/TensorflowProject/DCGAN-tensorflow-master$ sudo python main.py --dataset mnist --is_train True [sudo] password for ld: I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so.8.0 locally I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so.5 locally I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so.8.0 locally I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcuda.so.1 locally I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcurand.so.8.0 locally {'batch_size': 64, 'beta1': 0.5, 'c_dim': 3, 'checkpoint_dir': 'checkpoint', 'dataset': 'mnist', 'epoch': 25, 'image_size': 108, 'is_crop': False, 'is_train': True, 'learning_rate': 0.0002, 'output_size': 64, 'sample_dir': 'samples', 'train_size': inf, 'visualize': False} I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero I tensorflow/core/common_runtime/gpu/gpu_device.cc:885] Found device 0 with properties: name: GeForce GTX 1060 6GB major: 6 minor: 1 memoryClockRate (GHz) 1.759 pciBusID 0000:01:00.0 Total memory: 5.93GiB Free memory: 5.35GiB I tensorflow/core/common_runtime/gpu/gpu_device.cc:906] DMA: 0 I tensorflow/core/common_runtime/gpu/gpu_device.cc:916] 0: Y I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 1060 6GB, pci bus id: 0000:01:00.0) 0k yes 2 (<tf.Output 'real_images:0' shape=(64, 28, 28, 1) dtype=float32>, <tf.Output 'y:0' shape=(64, 10) dtype=float32>) 3 Traceback (most recent call last): File "main.py", line 64, in tf.app.run() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 43, in run sys.exit(main(sys.argv[:1] + flags_passthrough)) File "main.py", line 39, in main dataset_name=FLAGS.dataset, is_crop=FLAGS.is_crop, checkpoint_dir=FLAGS.checkpoint_dir, sample_dir=FLAGS.sample_dir) File "/home/ld/TensorflowProject/DCGAN-tensorflow-master/model.py", line 69, in init self.build_model() File "/home/ld/TensorflowProject/DCGAN-tensorflow-master/model.py", line 89, in build_model self.sampler = self.sampler(self.z,self.y) File "/home/ld/TensorflowProject/DCGAN-tensorflow-master/model.py", line 359, in sampler h0 = tf.nn.relu(self.g_bn0(linear(z, self.gfc_dim, 'g_h0_lin'))) File "/home/ld/TensorflowProject/DCGAN-tensorflow-master/ops.py", line 34, in call ema_apply_op = self.ema.apply([batch_mean, batch_var]) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/moving_averages.py", line 388, in apply self._averages[var], var, decay, zero_debias=zero_debias)) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/moving_averages.py", line 70, in assign_moving_average update_delta = _zero_debias(variable, value, decay) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/moving_averages.py", line 175, in _zero_debias trainable=False) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 1024, in get_variable custom_getter=custom_getter) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 850, in get_variable custom_getter=custom_getter) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 346, in get_variable validate_shape=validate_shape) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 331, in _true_getter caching_device=caching_device, validate_shape=validate_shape) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 650, in _get_single_variable "VarScope?" % name) ValueError: Variable g_bn0/g_bn0_2/g_bn0_2/moments_1/moments_1/mean/ExponentialMovingAverage/biased does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=None in VarScope?

may0324 commented 7 years ago

@myw8 Have you fixed this issue? I came across the same problem and i guess it relates to the new version of tensorflow

carpedm20 commented 7 years ago

Sorry. I'm working on this problem and it will be fixed soon. I didn't keep in mind about the problem of legacy which is caused by the fast and wide upgrade of TensorFlow.

myw8 commented 7 years ago

@may0324 I tried many times conclude the conclusion :use cuda7.5 cudnnV4 tensorflow 0.8