Description
i wrote
$ python run_exp.py --cfg stageI/cfg/birds.yml --gpu 0
and it prints out
Traceback (most recent call last):
File "run_exp.py", line 11, in
from stageI.model import CondGAN
File "/home/han/StackGAN/stageI/model.py", line 4, in
import prettytensor as pt
File "/home/han/anaconda2/lib/python2.7/site-packages/prettytensor/init.py", line 25, in
from prettytensor import funcs
File "/home/han/anaconda2/lib/python2.7/site-packages/prettytensor/funcs.py", line 25, in
from prettytensor.pretty_tensor_image_methods import *
File "/home/han/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_image_methods.py", line 135, in
class conv2d(prettytensor.VarStoreMethod):
File "/home/han/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_image_methods.py", line 145, in conv2d
bias=tf.zeros_initializer(),
TypeError: zeros_initializer() takes at least 1 argument (0 given)
what should i do?
please help me.
I'm running on Ubuntu 16.04, tensorflow r0.11 with cuda8.0 and cudnn5.1
Activity
seongkyun commentedon May 10, 2017
i solved this problem
firstly, upgrade tensorflow to R1.0.1
and move run_exp.py file /home/username/StackGAN/stageI to /home/username/StackGAN
second, install dependencies
$ pip install prettytensor
$ pip install easydict
$ pip install progressbar
third, upgrade code(misc, stageI, and stageII folder python codes) using tf_upgrade
(see : https://www.tensorflow.org/install/migration)
fourth, change misc/datasets.py
line 75, 76
h1 = np.floor((ori_size - self._imsize) * np.random.random())
w1 = np.floor((ori_size - self._imsize) * np.random.random())
to
h1 = int(np.floor((ori_size - self._imsize) * np.random.random()))
w1 = int(np.floor((ori_size - self._imsize) * np.random.random()))
now, i'm training dataset with
CPU : intel core i5-7600
GPU : Geforce GTX1060 (6GB ram)
with CUDA 8.0m cuDNN 5.1, Tensorflow-gpu 1.0.1
nashory commentedon Oct 11, 2017
I also found it was tf version issue.
Upgrading tf to higher version would solve the issue.
HOWEVER, if you upgrad the tf version into 1.0.1, you will get type error since tf 1.0.1 version have changed the argument order of tf.concat function. (google/prettytensor#48)
To avoid this error, you have to change the argument order of tf.concat (i.e. tf.concat(1, [c,z]) --> tf.concat[c,z], 1)
If you want modified stable version of this code, refer to my repo
(Same code with the author, but fixed bugs.)
leeeeeeo commentedon Apr 14, 2018
@seongkyun thank you nery much ! it really works !
chaowentao commentedon Apr 22, 2018
@leeeeeeo can you give me details of solution?Thanks a lot.
chaowentao commentedon Apr 22, 2018
@seongkyun @nashory can you tell me your tensorflow version?I want to run the stackGAN,but i am confused about how to configure the environment.Thanks a lot.
leeeeeeo commentedon Apr 22, 2018
@chaowentao version has already shown at the last of @seongkyun 's comment. and it really works. just follow his solution.
chaowentao commentedon Apr 22, 2018
@leeeeeeo thank you.I'll try it.
chaowentao commentedon Apr 22, 2018
@leeeeeeo Do i still need to redo the images processing?
leeeeeeo commentedon Apr 22, 2018
@chaowentao maybe. i did.
chaowentao commentedon Apr 22, 2018
@leeeeeeo my result is
W tensorflow/core/framework/op_kernel.cc:993] Internal: Failed launching ResizeNearestNeighbor
[[Node: g_net/apply_5/ResizeNearestNeighbor = ResizeNearestNeighbor[T=DT_FLOAT, align_corners=false, _device="/job:localhost/replica:0/task:0/gpu:0"](g_net/apply_4/Relu, g_net/apply_5/ResizeNearestNeighbor/size)]]
W tensorflow/core/framework/op_kernel.cc:993] Internal: Failed launching ResizeNearestNeighbor
[[Node: g_net/apply_5/ResizeNearestNeighbor = ResizeNearestNeighbor[T=DT_FLOAT, align_corners=false, _device="/job:localhost/replica:0/task:0/gpu:0"](g_net/apply_4/Relu, g_net/apply_5/ResizeNearestNeighbor/size)]]
Can you give me some advice?
ubuntu14.04LTS CUDA 8.0m cuDNN 5.1, Tensorflow-gpu 1.0.1
leeeeeeo commentedon Apr 22, 2018
@chaowentao somewhere went wrong. i didnt meet this. try again.
happytaoxiaoli commentedon Jun 6, 2018
its a version problem:
just change the version of tensorflow and prettytensor
pip install tensorflow-gpu==0.12.0rc0
pip install prettytensor==0.7.1
Fix config and move run_exp.py for both stages