hanzhanggit / StackGAN

MIT License
1.86k stars 457 forks source link

Stage II ValueError: slice index 0 of dimension 0 out of bounds. #20

Open Toni-Antonova opened 7 years ago

Toni-Antonova commented 7 years ago

Hello, I'm trying to run Stage II, but get a Value Error.

Below I've copied and pasted which tf version I'm using (which ran stage I successfully) and the terminal output when I try to run "python stageII/run_exp.py --cfg stageII/cfg/birds.yml --gpu 1".

ubuntu@ip-172-31-26-237:~/pynb/StackGAN-master$ pip show tensorflow
Name: tensorflow
Version: 0.11.0rc0
Summary: TensorFlow helps the tensors flow
Home-page: http://tensorflow.org/
Author: Google Inc.
Author-email: opensource@google.com
License: Apache 2.0
Location: /usr/local/lib/python2.7/dist-packages
Requires: mock, protobuf, numpy, wheel, six
ubuntu@ip-172-31-26-237:~/pynb/StackGAN-master$ pip show tensorflow-gpu
Name: tensorflow-gpu
Version: 0.12.0
Summary: TensorFlow helps the tensors flow
Home-page: http://tensorflow.org/
Author: Google Inc.
Author-email: opensource@google.com
License: Apache 2.0
Location: /usr/local/lib/python2.7/dist-packages
Requires: mock, numpy, protobuf, wheel, six
|tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcurand.so locally
Using config:
{'CONFIG_NAME': 'stageII',
 'DATASET_NAME': 'birds',
 'EMBEDDING_TYPE': 'cnn-rnn',
 'GAN': {'DF_DIM': 64,
         'EMBEDDING_DIM': 128,
         'GF_DIM': 128,
         'NETWORK_TYPE': 'default'},
 'GPU_ID': 1,
 'TEST': {'BATCH_SIZE': 64,
          'CAPTION_PATH': '',
          'HR_IMSIZE': 256,
          'LR_IMSIZE': 64,
          'NUM_COPY': 16,
          'PRETRAINED_MODEL': ''},
 'TRAIN': {'BATCH_SIZE': 16,
           'B_WRONG': True,
           'COEFF': {'KL': 2.0},
           'COND_AUGMENTATION': True,
           'DISCRIMINATOR_LR': 0.0002,
           'FINETUNE_LR': False,
           'FLAG': True,
           'FT_LR_RETIO': 0.1,
           'GENERATOR_LR': 0.0002,
           'LR_DECAY_EPOCH': 100,
           'MAX_EPOCH': 50,
           'NUM_COPY': 4,
           'NUM_EMBEDDING': 4,
           'PRETRAINED_EPOCH': 20,
           'PRETRAINED_MODEL': '/home/ubuntu/pynb/StackGAN-master/ckt_logs/birds/stageI_2017_06_20_02_48_33/model_2000.ckpt',
           'SNAPSHOT_INTERVAL': 2000},
 'Z_DIM': 100}
images:  (2933, 304, 304, 3)
embeddings:  (2933, 10, 1024)
list_filenames:  2933 001.Black_footed_Albatross/Black_Footed_Albatross_0046_18
images:  (8855, 304, 304, 3)
embeddings:  (8855, 10, 1024)
list_filenames:  8855 002.Laysan_Albatross/Laysan_Albatross_0002_1027
lr_imsize:  64
hr_image_shape [256, 256, 3]
lr_image_shape [64, 64, 3]
I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:925] 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:951] Found device 0 with properties: 
name: Tesla K80
major: 3 minor: 7 memoryClockRate (GHz) 0.8235
pciBusID 0000:00:1e.0
Total memory: 11.25GiB
Free memory: 11.13GiB
I tensorflow/core/common_runtime/gpu/gpu_device.cc:972] DMA: 0 
I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] 0:   Y 
I tensorflow/core/common_runtime/gpu/gpu_device.cc:1041] Creating TensorFlow device (/gpu:0) -> (device: 0, name: Tesla K80, pci bus id: 0000:00:1e.0)
Traceback (most recent call last):
  File "stageII/run_exp.py", line 71, in <module>
    algo.train()
  File "/home/ubuntu/pynb/StackGAN-master/stageII/trainer.py", line 463, in train
    counter = self.build_model(sess)
  File "/home/ubuntu/pynb/StackGAN-master/stageII/trainer.py", line 380, in build_model
    self.init_opt()
  File "/home/ubuntu/pynb/StackGAN-master/stageII/trainer.py", line 154, in init_opt
    self.visualization(cfg.TRAIN.NUM_COPY)
  File "/home/ubuntu/pynb/StackGAN-master/stageII/trainer.py", line 303, in visualization
    n, "test")
  File "/home/ubuntu/pynb/StackGAN-master/stageII/trainer.py", line 285, in visualize_one_superimage
    img = images[row * rows, :, :, :]
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py", line 383, in _SliceHelper
    name=name)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py", line 537, in strided_slice
    shrink_axis_mask=shrink_axis_mask)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_array_ops.py", line 2750, in strided_slice
    shrink_axis_mask=shrink_axis_mask, name=name)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 749, in apply_op
    op_def=op_def)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2382, in create_op
    set_shapes_for_outputs(ret)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1783, in set_shapes_for_outputs
    shapes = shape_func(op)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py", line 1645, in _DelegateStridedSliceShape
    return common_shapes.call_cpp_shape_fn(op, input_tensors_needed=[1, 2, 3])
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/common_shapes.py", line 596, in call_cpp_shape_fn
    raise ValueError(err.message)
ValueError: slice index 0 of dimension 0 out of bounds.