InfoGAN icon indicating copy to clipboard operation
InfoGAN copied to clipboard

The commond line "python launchers/run_mnist_exp.py" couldn't be excuted successfully

Open bin913 opened this issue 8 years ago • 21 comments

root@1b0611ffe472:/InfoGAN# PYTHONPATH='.' python launchers/run_mnist_exp.py Extracting MNIST/train-images-idx3-ubyte.gz Extracting MNIST/train-labels-idx1-ubyte.gz Extracting MNIST/t10k-images-idx3-ubyte.gz Extracting MNIST/t10k-labels-idx1-ubyte.gz --Return-- None

/InfoGAN/infogan/misc/custom_ops.py(121)call() 119 return input_layer.with_tensor(tf.matmul(input_, matrix) + bias, parameters=self.vars) 120 except Exception: --> 121 import ipdb; ipdb.set_trace()

ipdb>

bin913 avatar Jan 15 '17 09:01 bin913

Perhaps it is the version of tensorflow and prettytensor is different. I also had this problem before, but I don't have that environment now and can't provide further useful info...

Update(06.09.2017): Bellow TF and PT version works for me: (Thanks to @tornadomeet )

pip uninstall tensorflow
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0rc2-cp27-none-linux_x86_64.whl
pip install --upgrade $TF_BINARY_URL

pip uninstall prettytensor
pip install prettytensor==0.6.2

hope-yao avatar Jan 23 '17 05:01 hope-yao

I have the same issue. Just followed the instructions from the readme.

fenollp avatar Jan 23 '17 11:01 fenollp

I have the same issue, using the docker instructions.

An additional problem with the docker instructions is that I needed to:

export PYTHONPATH=$pwd

in order to find the infogan imports.

dkirkby avatar Jan 30 '17 18:01 dkirkby

Same issue. Seems like the infogan code was written for a slightly different tensorflow api.

$ git clone https://github.com/openai/InfoGAN

$ docker run -v $(pwd)/InfoGAN:/InfoGAN -w /InfoGAN -it -p 8888:8888 gcr.io/tensorflow/tensorflow:r0.9rc0-devel Unable to find image 'gcr.io/tensorflow/tensorflow:r0.9rc0-devel' locally r0.9rc0-devel: Pulling from gcr.io/tensorflow/tensorflow cad769d511ed: Pull complete c9d22f0474f3: Pull complete 6f3ab5a71b2f: Pull complete 8b59277d2f61: Pull complete 9b30b9ccd94a: Pull complete 3af54013c7c5: Pull complete 435b93b13bc6: Pull complete 897fd7fa53b7: Pull complete de316ff4a752: Pull complete 3fc415e7c601: Pull complete ce9a7fc25e47: Pull complete 5a11f95db76f: Pull complete 4dd8570beecf: Pull complete 4e5b3a6dd042: Pull complete a63bc4f33791: Pull complete c5405f3560f5: Pull complete 47530fe877d9: Pull complete cd2b98f6c89b: Pull complete 3d3b8f8edebc: Pull complete 16993ec04a58: Pull complete 7be981d18460: Pull complete 199d99d94c73: Pull complete 86772546b6c5: Pull complete db8d20430704: Pull complete Digest: sha256:feb0edeff4f1dfab1026479faaaadd520b7e3ad22e1223be6b984aaf22ebcc91 Status: Downloaded newer image for gcr.io/tensorflow/tensorflow:r0.9rc0-devel

root@0de0ea9fa724:/InfoGAN# pip install -r requirements.txt Collecting prettytensor (from -r requirements.txt (line 1)) /usr/local/lib/python2.7/dist-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning. SNIMissingWarning /usr/local/lib/python2.7/dist-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning Downloading prettytensor-0.7.4-py2-none-any.whl (276kB) 100% |################################| 276kB 2.6MB/s Collecting progressbar (from -r requirements.txt (line 2)) Downloading progressbar-2.3.tar.gz Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 3)) Collecting ipdb (from -r requirements.txt (line 4)) Downloading ipdb-0.10.2.tar.gz Requirement already satisfied (use --upgrade to upgrade): six>=1.10.0 in /usr/local/lib/python2.7/dist-packages (from prettytensor->-r requirements.txt (line 1)) Collecting enum34>=1.0.0 (from prettytensor->-r requirements.txt (line 1)) Downloading enum34-1.1.6-py2-none-any.whl Requirement already satisfied (use --upgrade to upgrade): ipython>=0.10.2 in /usr/local/lib/python2.7/dist-packages (from ipdb->-r requirements.txt (line 4)) Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/local/lib/python2.7/dist-packages (from ipdb->-r requirements.txt (line 4)) Requirement already satisfied (use --upgrade to upgrade): decorator in /usr/local/lib/python2.7/dist-packages (from ipython>=0.10.2->ipdb->-r requirements.txt (line 4)) Requirement already satisfied (use --upgrade to upgrade): pickleshare in /usr/local/lib/python2.7/dist-packages (from ipython>=0.10.2->ipdb->-r requirements.txt (line 4)) Requirement already satisfied (use --upgrade to upgrade): traitlets in /usr/local/lib/python2.7/dist-packages (from ipython>=0.10.2->ipdb->-r requirements.txt (line 4)) Requirement already satisfied (use --upgrade to upgrade): pexpect; sys_platform != "win32" in /usr/local/lib/python2.7/dist-packages (from ipython>=0.10.2->ipdb->-r requirements.txt (line 4)) Requirement already satisfied (use --upgrade to upgrade): simplegeneric>0.8 in /usr/local/lib/python2.7/dist-packages (from ipython>=0.10.2->ipdb->-r requirements.txt (line 4)) Requirement already satisfied (use --upgrade to upgrade): backports.shutil-get-terminal-size in /usr/local/lib/python2.7/dist-packages (from ipython>=0.10.2->ipdb->-r requirements.txt (line 4)) Requirement already satisfied (use --upgrade to upgrade): pathlib2; python_version in "2.6 2.7 3.2 3.3" in /usr/local/lib/python2.7/dist-packages (from pickleshare->ipython>=0.10.2->ipdb->-r requirements.txt (line 4)) Requirement already satisfied (use --upgrade to upgrade): ipython-genutils in /usr/local/lib/python2.7/dist-packages (from traitlets->ipython>=0.10.2->ipdb->-r requirements.txt (line 4)) Requirement already satisfied (use --upgrade to upgrade): ptyprocess>=0.5 in /usr/local/lib/python2.7/dist-packages (from pexpect; sys_platform != "win32"->ipython>=0.10.2->ipdb->-r requirements.txt (line 4)) Building wheels for collected packages: progressbar, ipdb Running setup.py bdist_wheel for progressbar ... done Stored in directory: /root/.cache/pip/wheels/5e/5f/94/5a6203a7df123c64c9650d2325906620af9ddbd2dff26989d8 Running setup.py bdist_wheel for ipdb ... done Stored in directory: /root/.cache/pip/wheels/04/db/1a/e2c0bd9217f95f90b4c6ec285e5da40347d0b959f030be7400 Successfully built progressbar ipdb Installing collected packages: enum34, prettytensor, progressbar, ipdb Successfully installed enum34-1.1.6 ipdb-0.10.2 prettytensor-0.7.4 progressbar-2.3 /usr/local/lib/python2.7/dist-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning You are using pip version 8.1.2, however version 9.0.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.

root@0de0ea9fa724:/InfoGAN# python launchers/run_mnist_exp.py Traceback (most recent call last): File "launchers/run_mnist_exp.py", line 3, in from infogan.misc.distributions import Uniform, Categorical, Gaussian, MeanBernoulli ImportError: No module named infogan.misc.distributions

root@0de0ea9fa724:/InfoGAN# python launchers/run_mnist_exp.py Traceback (most recent call last): File "launchers/run_mnist_exp.py", line 3, in from infogan.misc.distributions import Uniform, Categorical, Gaussian, MeanBernoulli ImportError: No module named infogan.misc.distributions

root@0de0ea9fa724:/InfoGAN# ls README.md infogan launchers requirements.txt tests

root@0de0ea9fa724:/InfoGAN# PYTHONPATH='.' python launchers/run_mnist_exp.py Traceback (most recent call last): File "launchers/run_mnist_exp.py", line 8, in from infogan.models.regularized_gan import RegularizedGAN File "/InfoGAN/infogan/models/regularized_gan.py", line 2, in import prettytensor as pt File "/usr/local/lib/python2.7/dist-packages/prettytensor/init.py", line 25, in from prettytensor import funcs File "/usr/local/lib/python2.7/dist-packages/prettytensor/funcs.py", line 25, in from prettytensor.pretty_tensor_image_methods import * File "/usr/local/lib/python2.7/dist-packages/prettytensor/pretty_tensor_image_methods.py", line 135, in class conv2d(prettytensor.VarStoreMethod): File "/usr/local/lib/python2.7/dist-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)

root@0de0ea9fa724:/InfoGAN# export PYTHONPATH=pwd root@0de0ea9fa724:/InfoGAN# python launchers/run_mnist_exp.py Traceback (most recent call last): File "launchers/run_mnist_exp.py", line 8, in from infogan.models.regularized_gan import RegularizedGAN File "/InfoGAN/infogan/models/regularized_gan.py", line 2, in import prettytensor as pt File "/usr/local/lib/python2.7/dist-packages/prettytensor/init.py", line 25, in from prettytensor import funcs File "/usr/local/lib/python2.7/dist-packages/prettytensor/funcs.py", line 25, in from prettytensor.pretty_tensor_image_methods import * File "/usr/local/lib/python2.7/dist-packages/prettytensor/pretty_tensor_image_methods.py", line 135, in class conv2d(prettytensor.VarStoreMethod): File "/usr/local/lib/python2.7/dist-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)

I can then change all instances of tf.zeros_initializer() to tf.constant_initializer(0.0) per https://github.com/tensorflow/tensorflow/issues/6202 but then a different error occurs:

root@0de0ea9fa724:/InfoGAN# python launchers/run_mnist_exp.py Traceback (most recent call last): File "launchers/run_mnist_exp.py", line 8, in from infogan.models.regularized_gan import RegularizedGAN File "/InfoGAN/infogan/models/regularized_gan.py", line 2, in import prettytensor as pt File "/usr/local/lib/python2.7/dist-packages/prettytensor/init.py", line 25, in from prettytensor import funcs File "/usr/local/lib/python2.7/dist-packages/prettytensor/funcs.py", line 27, in from prettytensor.pretty_tensor_methods import * File "/usr/local/lib/python2.7/dist-packages/prettytensor/pretty_tensor_methods.py", line 709, in prettytensor.Register(tf.stack) AttributeError: 'module' object has no attribute 'stack'

aday00 avatar Mar 30 '17 17:03 aday00

@aday00 Yes. Use the version of tensorflow specified in the README

tlbtlbtlb avatar Mar 30 '17 17:03 tlbtlbtlb

Thanks so much @tlbtlbtlb! I can go for the current devel branch that has these api changes, or i could change the code back to use the api for the docker image i ran. Below, I try the first then the second. Even further below, I try tensorflow 1.0.0-devel-gpu and latest-devel-gpu which appear to have api and cuda issues, respectively. If nothing else I'd just like to document this.

tf.stack and tf.unstack are more recent the tf.pack and tf.unpack, so changing stack to pack fixes the AttributeError i reported in the previous comment. See also https://www.tensorflow.org/install/migration #prettytensor.Register(tf.stack) prettytensor.Register(tf.pack) #prettytensor.Register(tf.unstack) prettytensor.Register(tf.unpack)

Then i can reach: root@9a1b3ff013a1:/InfoGAN# python launchers/run_mnist_exp.py Successfully downloaded train-images-idx3-ubyte.gz 9912422 bytes. Extracting MNIST/train-images-idx3-ubyte.gz Successfully downloaded train-labels-idx1-ubyte.gz 28881 bytes. Extracting MNIST/train-labels-idx1-ubyte.gz Successfully downloaded t10k-images-idx3-ubyte.gz 1648877 bytes. Extracting MNIST/t10k-images-idx3-ubyte.gz Successfully downloaded t10k-labels-idx1-ubyte.gz 4542 bytes. Extracting MNIST/t10k-labels-idx1-ubyte.gz --Return-- None

/InfoGAN/infogan/misc/custom_ops.py(121)call() 119 return input_layer.with_tensor(tf.matmul(input_, matrix) + bias, parameters=self.vars) 120 except Exception: --> 121 import ipdb; ipdb.set_trace()

ipdb> Exiting Debugger.

Control+D out of the debugger leaves me with some MNIST data. root@9a1b3ff013a1:/InfoGAN# ls MNIST README.md ckt infogan launchers logs requirements.txt tests root@9a1b3ff013a1:/InfoGAN# ls -hal MNIST total 23M drwxr-xr-x 2 root root 512 Mar 30 18:05 . drwxr-xr-x 9 20101 4032 512 Mar 30 18:05 .. -rw------- 1 root root 1.6M Mar 30 18:05 t10k-images-idx3-ubyte.gz -rw------- 1 root root 4.5K Mar 30 18:05 t10k-labels-idx1-ubyte.gz -rw------- 1 root root 9.5M Mar 30 18:05 train-images-idx3-ubyte.gz -rw------- 1 root root 29K Mar 30 18:05 train-labels-idx1-ubyte.gz

Now I'll try getting a tensorflow 1.0 instead, since prettytensor's readme suggests some changes were recently made 'in anticipation of TF1.0' https://github.com/google/prettytensor/commit/75daa0b11252590f548da5647addc0ea610c4c45

Not sure what I'm doing, but https://hub.docker.com/r/tensorflow/tensorflow/tags/ suggests a variety of tags, including 1.0.0-devel-gpu

$ docker run -v $(pwd)/InfoGAN:/InfoGAN -w /InfoGAN -it -p 8888:8888 gcr.io/tensorflow/tensorflow:1.0.0-devel-gpu

root@7611f5c869c3:/InfoGAN# pip install -r requirements.txt

root@7611f5c869c3:/InfoGAN# export PYTHONPATH=pwd root@7611f5c869c3:/InfoGAN# python launchers/run_mnist_exp.py I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcublas.so.8.0 locally I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcudnn.so.5 locally I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcufft.so.8.0 locally I tensorflow/stream_executor/dso_loader.cc:126] Couldn't open CUDA library libcuda.so.1. LD_LIBRARY_PATH: /usr/local/cuda/extras/CUPTI/lib64:/usr/local/nvidia/lib:/usr/local/nvidia/lib64: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:165] hostname: 7611f5c869c3 I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:189] libcuda reported version is: Not found: was unable to find libcuda.so DSO loaded into this program I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:363] driver version file contents: """NVRM version: NVIDIA UNIX x86_64 Kernel Module 367.48 Sat Sep 3 18:21:08 PDT 2016 GCC version: gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) """ I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:193] kernel reported version is: 367.48.0 I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1065] LD_LIBRARY_PATH: /usr/local/cuda/extras/CUPTI/lib64:/usr/local/nvidia/lib:/usr/local/nvidia/lib64: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1066] failed to find libcuda.so on this system: Failed precondition: could not dlopen DSO: libcuda.so.1; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcurand.so.8.0 locally Extracting MNIST/train-images-idx3-ubyte.gz Extracting MNIST/train-labels-idx1-ubyte.gz Extracting MNIST/t10k-images-idx3-ubyte.gz Extracting MNIST/t10k-labels-idx1-ubyte.gz Traceback (most recent call last): File "launchers/run_mnist_exp.py", line 65, in algo.train() File "/InfoGAN/infogan/algos/infogan_trainer.py", line 210, in train self.init_opt() File "/InfoGAN/infogan/algos/infogan_trainer.py", line 51, in init_opt z_var = self.model.latent_dist.sample_prior(self.batch_size) File "/InfoGAN/infogan/misc/distributions.py", line 443, in sample_prior return tf.concat(1, ret) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py", line 1047, in concat dtype=dtypes.int32).get_shape( File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 651, in convert_to_tensor as_ref=False) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 716, in internal_convert_to_tensor ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/constant_op.py", line 176, in _constant_tensor_conversion_function return constant(v, dtype=dtype, name=name) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/constant_op.py", line 165, in constant tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape, verify_shape=verify_shape)) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_util.py", line 367, in make_tensor_proto _AssertCompatible(values, dtype) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_util.py", line 302, in _AssertCompatible (dtype.name, repr(mismatch), type(mismatch).name)) TypeError: Expected int32, got list containing Tensors of type '_Message' instead.

Trying again, moving the prior (and possibly incomplete) MNIST download off to the side.

root@7611f5c869c3:/InfoGAN# ls MNIST README.md ckt infogan launchers logs requirements.txt tests

root@7611f5c869c3:/InfoGAN# mv MNIST MNIST.00

root@7611f5c869c3:/InfoGAN# ls -hal MNIST.00 total 23M drwxr-xr-x 2 root root 512 Mar 30 18:05 . drwxr-xr-x 9 20101 4032 512 Mar 30 18:50 .. -rw------- 1 root root 1.6M Mar 30 18:05 t10k-images-idx3-ubyte.gz -rw------- 1 root root 4.5K Mar 30 18:05 t10k-labels-idx1-ubyte.gz -rw------- 1 root root 9.5M Mar 30 18:05 train-images-idx3-ubyte.gz -rw------- 1 root root 29K Mar 30 18:05 train-labels-idx1-ubyte.gz

Trying again just downloads MNIST again and reproduces the problem.

root@7611f5c869c3:/InfoGAN# python launchers/run_mnist_exp.py I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcublas.so.8.0 locally I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcudnn.so.5 locally I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcufft.so.8.0 locally I tensorflow/stream_executor/dso_loader.cc:126] Couldn't open CUDA library libcuda.so.1. LD_LIBRARY_PATH: /usr/local/cuda/extras/CUPTI/lib64:/usr/local/nvidia/lib:/usr/local/nvidia/lib64: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:165] hostname: 7611f5c869c3 I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:189] libcuda reported version is: Not found: was unable to find libcuda.so DSO loaded into this program I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:363] driver version file contents: """NVRM version: NVIDIA UNIX x86_64 Kernel Module 367.48 Sat Sep 3 18:21:08 PDT 2016 GCC version: gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) """ I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:193] kernel reported version is: 367.48.0 I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1065] LD_LIBRARY_PATH: /usr/local/cuda/extras/CUPTI/lib64:/usr/local/nvidia/lib:/usr/local/nvidia/lib64: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1066] failed to find libcuda.so on this system: Failed precondition: could not dlopen DSO: libcuda.so.1; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcurand.so.8.0 locally Successfully downloaded train-images-idx3-ubyte.gz 9912422 bytes. Extracting MNIST/train-images-idx3-ubyte.gz Successfully downloaded train-labels-idx1-ubyte.gz 28881 bytes. Extracting MNIST/train-labels-idx1-ubyte.gz Successfully downloaded t10k-images-idx3-ubyte.gz 1648877 bytes. Extracting MNIST/t10k-images-idx3-ubyte.gz Successfully downloaded t10k-labels-idx1-ubyte.gz 4542 bytes. Extracting MNIST/t10k-labels-idx1-ubyte.gz Traceback (most recent call last): File "launchers/run_mnist_exp.py", line 65, in algo.train() File "/InfoGAN/infogan/algos/infogan_trainer.py", line 210, in train self.init_opt() File "/InfoGAN/infogan/algos/infogan_trainer.py", line 51, in init_opt z_var = self.model.latent_dist.sample_prior(self.batch_size) File "/InfoGAN/infogan/misc/distributions.py", line 443, in sample_prior return tf.concat(1, ret) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py", line 1047, in concat dtype=dtypes.int32).get_shape( File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 651, in convert_to_tensor as_ref=False) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 716, in internal_convert_to_tensor ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/constant_op.py", line 176, in _constant_tensor_conversion_function return constant(v, dtype=dtype, name=name) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/constant_op.py", line 165, in constant tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape, verify_shape=verify_shape)) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_util.py", line 367, in make_tensor_proto _AssertCompatible(values, dtype) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_util.py", line 302, in _AssertCompatible (dtype.name, repr(mismatch), type(mismatch).name)) TypeError: Expected int32, got list containing Tensors of type '_Message' instead.

root@7611f5c869c3:/InfoGAN# ls
MNIST MNIST.00 README.md ckt infogan launchers logs requirements.txt tests

root@7611f5c869c3:/InfoGAN# ls -hal MNIST total 23M drwxr-xr-x 2 root root 512 Mar 30 18:52 . drwxr-xr-x 10 20101 4032 512 Mar 30 18:52 .. -rw-r--r-- 1 root root 1.6M Mar 30 18:52 t10k-images-idx3-ubyte.gz -rw-r--r-- 1 root root 4.5K Mar 30 18:52 t10k-labels-idx1-ubyte.gz -rw-r--r-- 1 root root 9.5M Mar 30 18:52 train-images-idx3-ubyte.gz -rw-r--r-- 1 root root 29K Mar 30 18:52 train-labels-idx1-ubyte.gz

The bit about "TypeError: Expected int32, got list containing Tensors of type '_Message' instead." strikes me either as a bug or another old-software problem, e.g. https://stackoverflow.com/questions/37098155/tensorflow-typeerror-expected-int32-got-list-containing-tensors-of-type-me mentions upgrading Keras versions solves the problem.

So, perhaps the nightly dev gpu build of tensforflow's the solution.

$ docker run -v $(pwd)/InfoGAN:/InfoGAN -w /InfoGAN -it -p 8888:8888 gcr.io/tensorflow/tensorflow:nightly-devel-gpu Unable to find image 'gcr.io/tensorflow/tensorflow:nightly-devel-gpu' locally Pulling repository gcr.io/tensorflow/tensorflow Tag nightly-devel-gpu not found in repository gcr.io/tensorflow/tensorflow

Ok, how about latest dev gpu build?

$ docker run -v $(pwd)/InfoGAN:/InfoGAN -w /InfoGAN -it -p 8888:8888 gcr.io/tensorflow/tensorflow:latest-devel-gpu ... 3bc2d4e0d6a9: Pull complete Digest: sha256:7f7e8d6cddeba8aa4c0df2e9b4971d60e5a541b160bbc3eccfe998d6fd915fe9 Status: Downloaded newer image for gcr.io/tensorflow/tensorflow:latest-devel-gpu

root@b5dc9d6adc93:/InfoGAN# ls MNIST MNIST.00 README.md ckt infogan launchers logs requirements.txt tests

root@b5dc9d6adc93:/InfoGAN# mv MNIST MNIST.01

root@b5dc9d6adc93:/InfoGAN# pip install -r requirements.txt Collecting prettytensor (from -r requirements.txt (line 1)) Downloading prettytensor-0.7.4-py2-none-any.whl (276kB) 100% |################################| 276kB 3.2MB/s Collecting progressbar (from -r requirements.txt (line 2)) Downloading progressbar-2.3.tar.gz Requirement already satisfied: python-dateutil in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 3)) Collecting ipdb (from -r requirements.txt (line 4)) Downloading ipdb-0.10.2.tar.gz Requirement already satisfied: six>=1.10.0 in /usr/local/lib/python2.7/dist-packages (from prettytensor->-r requirements.txt (line 1)) Requirement already satisfied: enum34>=1.0.0 in /usr/local/lib/python2.7/dist-packages (from prettytensor->-r requirements.txt (line 1)) Requirement already satisfied: ipython>=0.10.2 in /usr/local/lib/python2.7/dist-packages (from ipdb->-r requirements.txt (line 4)) Requirement already satisfied: setuptools in /usr/local/lib/python2.7/dist-packages (from ipdb->-r requirements.txt (line 4)) Requirement already satisfied: pickleshare in /usr/local/lib/python2.7/dist-packages (from ipython>=0.10.2->ipdb->-r requirements.txt (line 4)) Requirement already satisfied: simplegeneric>0.8 in /usr/local/lib/python2.7/dist-packages (from ipython>=0.10.2->ipdb->-r requirements.txt (line 4)) Requirement already satisfied: traitlets>=4.2 in /usr/local/lib/python2.7/dist-packages (from ipython>=0.10.2->ipdb->-r requirements.txt (line 4)) Requirement already satisfied: backports.shutil-get-terminal-size; python_version == "2.7" in /usr/local/lib/python2.7/dist-packages (from ipython>=0.10.2->ipdb->-r requirements.txt (line 4)) Requirement already satisfied: decorator in /usr/local/lib/python2.7/dist-packages (from ipython>=0.10.2->ipdb->-r requirements.txt (line 4)) Requirement already satisfied: pygments in /usr/local/lib/python2.7/dist-packages (from ipython>=0.10.2->ipdb->-r requirements.txt (line 4)) Requirement already satisfied: pexpect; sys_platform != "win32" in /usr/local/lib/python2.7/dist-packages (from ipython>=0.10.2->ipdb->-r requirements.txt (line 4)) Requirement already satisfied: pathlib2; python_version == "2.7" or python_version == "3.3" in /usr/local/lib/python2.7/dist-packages (from ipython>=0.10.2->ipdb->-r requirements.txt (line 4)) Requirement already satisfied: prompt-toolkit<2.0.0,>=1.0.4 in /usr/local/lib/python2.7/dist-packages (from ipython>=0.10.2->ipdb->-r requirements.txt (line 4)) Requirement already satisfied: appdirs>=1.4.0 in /usr/local/lib/python2.7/dist-packages (from setuptools->ipdb->-r requirements.txt (line 4)) Requirement already satisfied: packaging>=16.8 in /usr/local/lib/python2.7/dist-packages (from setuptools->ipdb->-r requirements.txt (line 4)) Requirement already satisfied: ipython-genutils in /usr/local/lib/python2.7/dist-packages (from traitlets>=4.2->ipython>=0.10.2->ipdb->-r requirements.txt (line 4)) Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python2.7/dist-packages (from pexpect; sys_platform != "win32"->ipython>=0.10.2->ipdb->-r requirements.txt (line 4)) Requirement already satisfied: scandir; python_version < "3.5" in /usr/local/lib/python2.7/dist-packages (from pathlib2; python_version == "2.7" or python_version == "3.3"->ipython>=0.10.2->ipdb->-r requirements.txt (line 4)) Requirement already satisfied: wcwidth in /usr/local/lib/python2.7/dist-packages (from prompt-toolkit<2.0.0,>=1.0.4->ipython>=0.10.2->ipdb->-r requirements.txt (line 4)) Requirement already satisfied: pyparsing in /usr/local/lib/python2.7/dist-packages (from packaging>=16.8->setuptools->ipdb->-r requirements.txt (line 4)) Building wheels for collected packages: progressbar, ipdb Running setup.py bdist_wheel for progressbar ... done Stored in directory: /root/.cache/pip/wheels/5e/5f/94/5a6203a7df123c64c9650d2325906620af9ddbd2dff26989d8 Running setup.py bdist_wheel for ipdb ... done Stored in directory: /root/.cache/pip/wheels/04/db/1a/e2c0bd9217f95f90b4c6ec285e5da40347d0b959f030be7400 Successfully built progressbar ipdb Installing collected packages: prettytensor, progressbar, ipdb Successfully installed ipdb-0.10.2 prettytensor-0.7.4 progressbar-2.3

root@b5dc9d6adc93:/InfoGAN# export PYTHONPATH=pwd

root@b5dc9d6adc93:/InfoGAN# python launchers/run_mnist_exp.py Traceback (most recent call last): File "launchers/run_mnist_exp.py", line 3, in from infogan.misc.distributions import Uniform, Categorical, Gaussian, MeanBernoulli File "/InfoGAN/infogan/misc/distributions.py", line 4, in import tensorflow as tf File "/usr/local/lib/python2.7/dist-packages/tensorflow/init.py", line 24, in from tensorflow.python import * File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/init.py", line 51, in from tensorflow.python import pywrap_tensorflow File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in raise ImportError(msg) ImportError: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in from tensorflow.python.pywrap_tensorflow_internal import * File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) ImportError: libcuda.so.1: cannot open shared object file: No such file or directory

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions. Include the entire stack trace above this error message when asking for help.

So latest-devel-gpu seems to have a CUDA problem, whereas 1.0.0-devel-gpu found CUDA but had presumably api problems.

aday00 avatar Mar 30 '17 19:03 aday00

Ideally, use the particular commit ID referenced in the README. But latest-devel-gpu should work too.

Installing libcuda is documented at https://www.tensorflow.org/install/install_linux#NVIDIARequirements

tlbtlbtlb avatar Mar 30 '17 20:03 tlbtlbtlb

Thanks @tlbtlbtlb! It's really great to get some guidance from you! I tried checking out that specific commit but hit a v2 registry error, and then got api errors when trying various cpu-only images.

This page https://docs.docker.com/engine/reference/commandline/pull/ mentions how to check out a specific commit by sha256, and the mentioned commit is https://github.com/tensorflow/tensorflow/commit/79174afa30046ecdc437b531812f2cb41a32695e so:

$ docker run -v $(pwd)/InfoGAN:/InfoGAN -w /InfoGAN -it -p 8888:8888 gcr.io/tensorflow/tensorflow@sha256:79174afa30046ecdc437b531812f2cb41a32695e Unable to find image 'gcr.io/tensorflow/tensorflow@sha256:79174afa30046ecdc437b531812f2cb41a32695e' locally Error response from daemon: pulling with digest reference failed from v2 registry

My read of https://github.com/openshift/origin/issues/4567 is that this error means I need to register with some authentication system to do the pull. My read of https://bugzilla.redhat.com/show_bug.cgi?id=1255502 is that this means my docker client should be updated.

For completeness, trying variations of the pull command don't work either.

$ docker run -v $(pwd)/InfoGAN:/InfoGAN -w /InfoGAN -it -p 8888:8888 gcr.io/tensorflow/tensorflow@sha256:79174a
Unable to find image 'gcr.io/tensorflow/tensorflow@sha256:79174a' locally Error response from daemon: pulling with digest reference failed from v2 registry

$ docker run -v $(pwd)/InfoGAN:/InfoGAN -w /InfoGAN -it -p 8888:8888 gcr.io/tensorflow/tensorflow:79174a Unable to find image 'gcr.io/tensorflow/tensorflow:79174a' locally Pulling repository gcr.io/tensorflow/tensorflow Tag 79174a not found in repository gcr.io/tensorflow/tensorflow

How about a CPU-only attempt with latest-devel?

$ docker run -v $(pwd)/InfoGAN:/InfoGAN -w /InfoGAN -it -p 8888:8888 gcr.io/tensorflow/tensorflow:latest-devel ... Digest: sha256:6733a48dcbccb32c3f74f06a435ea282d51e2832663e522b5d3e3fc33ca7f543 Status: Downloaded newer image for gcr.io/tensorflow/tensorflow:latest-devel

root@40bdfdb1318b:/InfoGAN# ls MNIST.00 MNIST.01 README.md ckt infogan launchers logs requirements.txt tests

root@40bdfdb1318b:/InfoGAN# pip install -r requirements.txt

root@40bdfdb1318b:/InfoGAN# export PYTHONPATH=pwd root@40bdfdb1318b:/InfoGAN# python launchers/run_mnist_exp.py Successfully downloaded train-images-idx3-ubyte.gz 9912422 bytes. Extracting MNIST/train-images-idx3-ubyte.gz Successfully downloaded train-labels-idx1-ubyte.gz 28881 bytes. Extracting MNIST/train-labels-idx1-ubyte.gz Successfully downloaded t10k-images-idx3-ubyte.gz 1648877 bytes. Extracting MNIST/t10k-images-idx3-ubyte.gz Successfully downloaded t10k-labels-idx1-ubyte.gz 4542 bytes. Extracting MNIST/t10k-labels-idx1-ubyte.gz Traceback (most recent call last): File "launchers/run_mnist_exp.py", line 65, in algo.train() File "/InfoGAN/infogan/algos/infogan_trainer.py", line 210, in train self.init_opt() File "/InfoGAN/infogan/algos/infogan_trainer.py", line 51, in init_opt z_var = self.model.latent_dist.sample_prior(self.batch_size) File "/InfoGAN/infogan/misc/distributions.py", line 443, in sample_prior return tf.concat(1, ret) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py", line 1029, in concat dtype=dtypes.int32).get_shape( File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 639, in convert_to_tensor as_ref=False) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 704, in internal_convert_to_tensor ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/constant_op.py", line 113, in _constant_tensor_conversion_function return constant(v, dtype=dtype, name=name) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/constant_op.py", line 102, in constant tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape, verify_shape=verify_shape)) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_util.py", line 370, in make_tensor_proto _AssertCompatible(values, dtype) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_util.py", line 302, in _AssertCompatible (dtype.name, repr(mismatch), type(mismatch).name)) TypeError: Expected int32, got list containing Tensors of type '_Message' instead.

root@40bdfdb1318b:/InfoGAN# ls MNIST MNIST.00 MNIST.01 README.md ckt infogan launchers logs requirements.txt tests root@40bdfdb1318b:/InfoGAN# rm -rf MNIST root@40bdfdb1318b:/InfoGAN# ls MNIST.00 MNIST.01 README.md ckt infogan launchers logs requirements.txt tests

So latest-devel and latest-devel-gpu both have some sort of api issue. Let's try 1.0.0-devel rather than 1.0.0-devel-gpu.

$ docker run -v $(pwd)/InfoGAN:/InfoGAN -w /InfoGAN -it -p 8888:8888 gcr.io/tensorflow/tensorflow:1.0.0-devel ... Digest: sha256:43452820c0d684e7be7aee18ac0423092a94a2b215cc7f8b0b0078be43a01224 Status: Downloaded newer image for gcr.io/tensorflow/tensorflow:1.0.0-devel

root@48269e969ce3:/InfoGAN# pip install -r requirements.txt

root@48269e969ce3:/InfoGAN# export PYTHONPATH=pwd root@48269e969ce3:/InfoGAN# python launchers/run_mnist_exp.py Successfully downloaded train-images-idx3-ubyte.gz 9912422 bytes. Extracting MNIST/train-images-idx3-ubyte.gz Successfully downloaded train-labels-idx1-ubyte.gz 28881 bytes. Extracting MNIST/train-labels-idx1-ubyte.gz Successfully downloaded t10k-images-idx3-ubyte.gz 1648877 bytes. Extracting MNIST/t10k-images-idx3-ubyte.gz Successfully downloaded t10k-labels-idx1-ubyte.gz 4542 bytes. Extracting MNIST/t10k-labels-idx1-ubyte.gz Traceback (most recent call last): File "launchers/run_mnist_exp.py", line 65, in algo.train() File "/InfoGAN/infogan/algos/infogan_trainer.py", line 210, in train self.init_opt() File "/InfoGAN/infogan/algos/infogan_trainer.py", line 51, in init_opt z_var = self.model.latent_dist.sample_prior(self.batch_size) File "/InfoGAN/infogan/misc/distributions.py", line 443, in sample_prior return tf.concat(1, ret) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py", line 1047, in concat dtype=dtypes.int32).get_shape( File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 651, in convert_to_tensor as_ref=False) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 716, in internal_convert_to_tensor ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/constant_op.py", line 176, in _constant_tensor_conversion_function return constant(v, dtype=dtype, name=name) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/constant_op.py", line 165, in constant tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape, verify_shape=verify_shape)) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_util.py", line 367, in make_tensor_proto _AssertCompatible(values, dtype) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_util.py", line 302, in _AssertCompatible (dtype.name, repr(mismatch), type(mismatch).name)) TypeError: Expected int32, got list containing Tensors of type '_Message' instead.

Another api issue. Maybe I should try this all on a different system.

aday00 avatar Mar 31 '17 07:03 aday00

On a different system, the api issue reproduces (per comment above) for this docker image.

root# docker run -v $(pwd)/InfoGAN:/InfoGAN -w /InfoGAN -it -p 8888:8888 gcr.io/tensorflow/tensorflow:1.0.0-devel

On this different system, when trying to checkout a specific commit, the v2 registry error does not reproduce, but the 'tag cannot be found'. Maybe I can't check out specific commits?

root# docker run -v $(pwd)/InfoGAN:/InfoGAN -w /InfoGAN -it -p 8888:8888 gcr.io/tensorflow/tensorflow@sha256:79174afa30046ecdc437b531812f2cb41a32695e Unable to find image 'gcr.io/tensorflow/tensorflow@sha256:79174afa30046ecdc437b531812f2cb41a32695e' locally Pulling repository gcr.io/tensorflow/tensorflow FATA[0001] Tag sha256:79174afa30046ecdc437b531812f2cb41a32695e not found in repository gcr.io/tensorflow/tensorflow

Could someone please provide a working docker commandline?

aday00 avatar Apr 02 '17 08:04 aday00

Where did you get gcr.io/tensorflow/tensorflow@sha256:79174afa30046ecdc437b531812f2cb41a32695e? If the tensorflow didn't create an image with that tag, then there isn't one.

tlbtlbtlb avatar Apr 04 '17 16:04 tlbtlbtlb

Many thanks @tlbtlbtlb for such sustained help! The InfoGAN README says "As of the release, the latest commit is 79174a.", which links to https://github.com/tensorflow/tensorflow/commit/79174afa30046ecdc437b531812f2cb41a32695e so I used that sha256.

I'm not sure how to read the github page https://github.com/tensorflow/tensorflow/commit/79174afa30046ecdc437b531812f2cb41a32695e for that commit, but maybe this suggests the commit is in tagged releases v1.1.0-rc1 through 0.12.0-rc0. Should I try the latest tag with this commit:

$ docker run -v $(pwd)/InfoGAN:/InfoGAN -w /InfoGAN -it -p 8888:8888 gcr.io/tensorflow/tensorflow:1.1.0-rc1-devel Unable to find image 'gcr.io/tensorflow/tensorflow:1.1.0-rc1-devel' locally Pulling repository gcr.io/tensorflow/tensorflow Tag 1.1.0-rc1-devel not found in repository gcr.io/tensorflow/tensorflow

How about rc0 instead of rc1?

$ docker run -v $(pwd)/InfoGAN:/InfoGAN -w /InfoGAN -it -p 8888:8888 gcr.io/tensorflow/tensorflow:1.1.0-rc0-devel Unable to find image 'gcr.io/tensorflow/tensorflow:1.1.0-rc0-devel' locally 1.1.0-rc0-devel: Pulling from gcr.io/tensorflow/tensorflow bdb22cfb4841: Pull complete ... 5e3e8ad665c0: Already exists Digest: sha256:6733a48dcbccb32c3f74f06a435ea282d51e2832663e522b5d3e3fc33ca7f543 Status: Downloaded newer image for gcr.io/tensorflow/tensorflow:1.1.0-rc0-devel

root@e3c5e3fbc391:/InfoGAN# pip install -r requirements.txt

root@e3c5e3fbc391:/InfoGAN# export PYTHONPATH=pwd root@e3c5e3fbc391:/InfoGAN# python launchers/run_mnist_exp.py Extracting MNIST/train-images-idx3-ubyte.gz Extracting MNIST/train-labels-idx1-ubyte.gz Extracting MNIST/t10k-images-idx3-ubyte.gz Extracting MNIST/t10k-labels-idx1-ubyte.gz Traceback (most recent call last): File "launchers/run_mnist_exp.py", line 65, in algo.train() File "/InfoGAN/infogan/algos/infogan_trainer.py", line 210, in train self.init_opt() File "/InfoGAN/infogan/algos/infogan_trainer.py", line 51, in init_opt z_var = self.model.latent_dist.sample_prior(self.batch_size) File "/InfoGAN/infogan/misc/distributions.py", line 443, in sample_prior return tf.concat(1, ret) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py", line 1029, in concat dtype=dtypes.int32).get_shape( File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 639, in convert_to_tensor as_ref=False) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 704, in internal_convert_to_tensor ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/constant_op.py", line 113, in _constant_tensor_conversion_function return constant(v, dtype=dtype, name=name) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/constant_op.py", line 102, in constant tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape, verify_shape=verify_shape)) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_util.py", line 370, in make_tensor_proto _AssertCompatible(values, dtype) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_util.py", line 302, in _AssertCompatible (dtype.name, repr(mismatch), type(mismatch).name)) TypeError: Expected int32, got list containing Tensors of type '_Message' instead.

Same issue.

aday00 avatar Apr 05 '17 03:04 aday00

That sha is for the source on github. So you have to build from source, following the instructions at https://www.tensorflow.org/install/install_sources, replacing Branch with 79174afa30046ecdc437b531812f2cb41a32695e

tlbtlbtlb avatar Apr 05 '17 05:04 tlbtlbtlb

Thanks again @tlbtlbtlb! Sorry for all my questions. I now checked out tensorflow and that specific commit as you suggest.

Worked through these instructions for a CPU-only build: https://www.tensorflow.org/install/install_sources

Installed bazel via Google's apt repo: https://bazel.build/versions/master/docs/install-ubuntu.html

Configured Tensorflow: https://www.tensorflow.org/install/install_sources#ConfigureInstallation

root:/path/to/tensorflow # ./configure Please specify the location of python. [Default is /usr/bin/python]: /usr/bin/python2.7 Do you wish to build TensorFlow with Google Cloud Platform support? [y/N] No Google Cloud Platform support will be enabled for TensorFlow Do you wish to build TensorFlow with GPU support? [y/N] No GPU support will be enabled for TensorFlow Configuration finished

root:/path/to/tensorflow # bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package WARNING: Config values are not defined in any .rc file: opt ERROR: /tmp/schaumba/t/tensorflow/tensorflow/tensorflow.bzl:482:19: name 'DATA_CFG' is not defined. ERROR: error loading package '': Extension 'tensorflow/tensorflow.bzl' has errors. INFO: Elapsed time: 0.061s Interesting to hit this issue despite having run configure: https://github.com/tensorflow/tensorflow/issues/7739

There is this outstanding issue with "name 'DATA_CFG' is not defined.", but if this Tensorflow version was indeed used for InfoGAN it must not be an issue. https://github.com/tensorflow/tensorflow/issues/7358

I have a typescript and can provide more info if desired. Separately, is there a Docker image of this specific version of Tensorflow with an InfoGAN build already at OpenAI? Should I try building a GPU-accelerated version instead of CPU-only?

aday00 avatar Apr 13 '17 08:04 aday00

Could some one help me with the following problem? Thank you so much! D:\ProgramData\Anaconda3\python.exe E:/GAN/InfoGAN-master/launchers/run_mnist_exp.py I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:135] successfully opened CUDA library cublas64_80.dll locally I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:135] successfully opened CUDA library cudnn64_5.dll locally I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:135] successfully opened CUDA library cufft64_80.dll locally I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:135] successfully opened CUDA library nvcuda.dll locally I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:135] successfully opened CUDA library curand64_80.dll locally Extracting MNIST\train-images-idx3-ubyte.gz Extracting MNIST\train-labels-idx1-ubyte.gz Extracting MNIST\t10k-images-idx3-ubyte.gz Extracting MNIST\t10k-labels-idx1-ubyte.gz E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "BestSplits" device_type: "CPU"') for unknown op: BestSplits E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "CountExtremelyRandomStats" device_type: "CPU"') for unknown op: CountExtremelyRandomStats E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "FinishedNodes" device_type: "CPU"') for unknown op: FinishedNodes E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "GrowTree" device_type: "CPU"') for unknown op: GrowTree E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "ReinterpretStringToFloat" device_type: "CPU"') for unknown op: ReinterpretStringToFloat E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "SampleInputs" device_type: "CPU"') for unknown op: SampleInputs E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "ScatterAddNdim" device_type: "CPU"') for unknown op: ScatterAddNdim E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "TopNInsert" device_type: "CPU"') for unknown op: TopNInsert E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "TopNRemove" device_type: "CPU"') for unknown op: TopNRemove E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "TreePredictions" device_type: "CPU"') for unknown op: TreePredictions E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "UpdateFertileSlots" device_type: "CPU"') for unknown op: UpdateFertileSlots Traceback (most recent call last): File "D:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 491, in apply_op preferred_dtype=default_dtype) File "D:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 702, in internal_convert_to_tensor ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref) File "D:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 575, in _TensorTensorConversionFunction % (dtype.name, t.dtype.name, str(t))) ValueError: Tensor conversion requested dtype int32 for Tensor with dtype float32: 'Tensor("custom_deconv2d/custom_deconv2d/stack:0", shape=(4,), dtype=float32)'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "E:/GAN/InfoGAN-master/launchers/run_mnist_exp.py", line 65, in algo.train() File "E:\GAN\InfoGAN-master\infogan\algos\infogan_trainer.py", line 210, in train self.init_opt() File "E:\GAN\InfoGAN-master\infogan\algos\infogan_trainer.py", line 52, in init_opt fake_x, _ = self.model.generate(z_var) File "E:\GAN\InfoGAN-master\infogan\models\regularized_gan.py", line 77, in generate x_dist_flat = self.generator_template.construct(input=z_var) File "D:\ProgramData\Anaconda3\lib\site-packages\prettytensor\pretty_tensor_class.py", line 1248, in construct return self._construct(context) File "D:\ProgramData\Anaconda3\lib\site-packages\prettytensor\pretty_tensor_class.py", line 1173, in _construct method_args = self._replace_deferred(self._method_args, context) File "D:\ProgramData\Anaconda3\lib\site-packages\prettytensor\pretty_tensor_class.py", line 1145, in _replace_deferred return [self._replace_deferred(x, context) for x in arg] File "D:\ProgramData\Anaconda3\lib\site-packages\prettytensor\pretty_tensor_class.py", line 1145, in return [self._replace_deferred(x, context) for x in arg] File "D:\ProgramData\Anaconda3\lib\site-packages\prettytensor\pretty_tensor_class.py", line 1140, in _replace_deferred return arg._construct(context) File "D:\ProgramData\Anaconda3\lib\site-packages\prettytensor\pretty_tensor_class.py", line 1173, in _construct method_args = self._replace_deferred(self._method_args, context) File "D:\ProgramData\Anaconda3\lib\site-packages\prettytensor\pretty_tensor_class.py", line 1145, in _replace_deferred return [self._replace_deferred(x, context) for x in arg] File "D:\ProgramData\Anaconda3\lib\site-packages\prettytensor\pretty_tensor_class.py", line 1145, in return [self._replace_deferred(x, context) for x in arg] File "D:\ProgramData\Anaconda3\lib\site-packages\prettytensor\pretty_tensor_class.py", line 1140, in _replace_deferred return arg._construct(context) File "D:\ProgramData\Anaconda3\lib\site-packages\prettytensor\pretty_tensor_class.py", line 1173, in _construct method_args = self._replace_deferred(self._method_args, context) File "D:\ProgramData\Anaconda3\lib\site-packages\prettytensor\pretty_tensor_class.py", line 1145, in _replace_deferred return [self._replace_deferred(x, context) for x in arg] File "D:\ProgramData\Anaconda3\lib\site-packages\prettytensor\pretty_tensor_class.py", line 1145, in return [self._replace_deferred(x, context) for x in arg] File "D:\ProgramData\Anaconda3\lib\site-packages\prettytensor\pretty_tensor_class.py", line 1140, in _replace_deferred return arg._construct(context) File "D:\ProgramData\Anaconda3\lib\site-packages\prettytensor\pretty_tensor_class.py", line 1173, in _construct method_args = self._replace_deferred(self._method_args, context) File "D:\ProgramData\Anaconda3\lib\site-packages\prettytensor\pretty_tensor_class.py", line 1145, in _replace_deferred return [self._replace_deferred(x, context) for x in arg] File "D:\ProgramData\Anaconda3\lib\site-packages\prettytensor\pretty_tensor_class.py", line 1145, in return [self._replace_deferred(x, context) for x in arg] File "D:\ProgramData\Anaconda3\lib\site-packages\prettytensor\pretty_tensor_class.py", line 1140, in _replace_deferred return arg._construct(context) File "D:\ProgramData\Anaconda3\lib\site-packages\prettytensor\pretty_tensor_class.py", line 1175, in _construct result = self._method(*method_args, **method_kwargs) File "D:\ProgramData\Anaconda3\lib\site-packages\prettytensor\scopes.py", line 158, in call return self._call_func(args, kwargs) File "D:\ProgramData\Anaconda3\lib\site-packages\prettytensor\scopes.py", line 131, in _call_func return self._func(*args, **kwargs) File "D:\ProgramData\Anaconda3\lib\site-packages\prettytensor\pretty_tensor_class.py", line 1924, in _with_method_complete return input_layer._method_complete(func(*args, **kwargs)) File "E:\GAN\InfoGAN-master\infogan\misc\custom_ops.py", line 91, in call strides=[1, d_h, d_w, 1]) File "D:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\ops\nn_ops.py", line 1077, in conv2d_transpose name=name) File "D:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\ops\gen_nn_ops.py", line 489, in conv2d_backprop_input data_format=data_format, name=name) File "D:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 509, in apply_op (prefix, dtypes.as_dtype(input_arg.type).name)) TypeError: Input 'input_sizes' of 'Conv2DBackpropInput' Op has type float32 that does not match expected type of int32.

originally defined at: File "E:/GAN/InfoGAN-master/launchers/run_mnist_exp.py", line 48, in network_type="mnist", File "E:\GAN\InfoGAN-master\infogan\models\regularized_gan.py", line 61, in init custom_deconv2d([0, image_size / 2, image_size / 2, 64], k_h=4, k_w=4).

howardgriffin avatar Apr 20 '17 02:04 howardgriffin

@aday00 This is really a tensorflow problem, try asking on their issue tracker. As a guess, it may require a different version of Bazel.

tlbtlbtlb avatar Apr 20 '17 02:04 tlbtlbtlb

@howardgriffin Your version of tensorflow doesn't match the version specified in the README

tlbtlbtlb avatar Apr 20 '17 02:04 tlbtlbtlb

solved this problem by: pip uninstall prettytensor pip install prettytensor==0.6.2

tornadomeet avatar May 31 '17 03:05 tornadomeet

I fixed this problem by making several updates to this code and one to prettytensor to accommodate the new TensorFlow API. You can get those changes in my fork of this repo.

zjost avatar Sep 25 '17 16:09 zjost

@zjost I have tried your fork. It still gives me an error: Successfully downloaded train-images-idx3-ubyte.gz 9912422 bytes. Extracting MNIST/train-images-idx3-ubyte.gz Successfully downloaded train-labels-idx1-ubyte.gz 28881 bytes. Extracting MNIST/train-labels-idx1-ubyte.gz Successfully downloaded t10k-images-idx3-ubyte.gz 1648877 bytes. Extracting MNIST/t10k-images-idx3-ubyte.gz Successfully downloaded t10k-labels-idx1-ubyte.gz 4542 bytes. Extracting MNIST/t10k-labels-idx1-ubyte.gz Traceback (most recent call last): File "launchers/run_mnist_exp.py", line 65, in algo.train() File "/home/tianle/work/deep_learning/InfoGAN/infogan/algos/infogan_trainer.py", line 210, in train self.init_opt() File "/home/tianle/work/deep_learning/InfoGAN/infogan/algos/infogan_trainer.py", line 52, in init_opt fake_x, _ = self.model.generate(z_var) File "/home/tianle/work/deep_learning/InfoGAN/infogan/models/regularized_gan.py", line 77, in generate x_dist_flat = self.generator_template.construct(input=z_var) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1248, in construct return self._construct(context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1173, in _construct method_args = self._replace_deferred(self._method_args, context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1145, in _replace_deferred return [self._replace_deferred(x, context) for x in arg] File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1140, in _replace_deferred return arg._construct(context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1173, in _construct method_args = self._replace_deferred(self._method_args, context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1145, in _replace_deferred return [self._replace_deferred(x, context) for x in arg] File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1140, in _replace_deferred return arg._construct(context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1173, in _construct method_args = self._replace_deferred(self._method_args, context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1145, in _replace_deferred return [self._replace_deferred(x, context) for x in arg] File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1140, in _replace_deferred return arg._construct(context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1173, in _construct method_args = self._replace_deferred(self._method_args, context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1145, in _replace_deferred return [self._replace_deferred(x, context) for x in arg] File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1140, in _replace_deferred return arg._construct(context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1173, in _construct method_args = self._replace_deferred(self._method_args, context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1145, in _replace_deferred return [self._replace_deferred(x, context) for x in arg] File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1140, in _replace_deferred return arg._construct(context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1173, in _construct method_args = self._replace_deferred(self._method_args, context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1145, in _replace_deferred return [self._replace_deferred(x, context) for x in arg] File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1140, in _replace_deferred return arg._construct(context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1173, in _construct method_args = self._replace_deferred(self._method_args, context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1145, in _replace_deferred return [self._replace_deferred(x, context) for x in arg] File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1140, in _replace_deferred return arg._construct(context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1173, in _construct method_args = self._replace_deferred(self._method_args, context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1145, in _replace_deferred return [self._replace_deferred(x, context) for x in arg] File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1140, in _replace_deferred return arg._construct(context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1173, in _construct method_args = self._replace_deferred(self._method_args, context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1145, in _replace_deferred return [self._replace_deferred(x, context) for x in arg] File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1140, in _replace_deferred return arg._construct(context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1173, in _construct method_args = self._replace_deferred(self._method_args, context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1145, in _replace_deferred return [self._replace_deferred(x, context) for x in arg] File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1140, in _replace_deferred return arg._construct(context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1173, in _construct method_args = self._replace_deferred(self._method_args, context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1145, in _replace_deferred return [self._replace_deferred(x, context) for x in arg] File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1140, in _replace_deferred return arg._construct(context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1173, in _construct method_args = self._replace_deferred(self._method_args, context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1145, in _replace_deferred return [self._replace_deferred(x, context) for x in arg] File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1140, in _replace_deferred return arg._construct(context) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1176, in _construct _strip_unnecessary_contents_from_stack(result, set()) File "/home/tianle/anaconda2/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1335, in _strip_unnecessary_contents_from_stack for f, line_no, method, _ in result._traceback: ValueError: too many values to unpack

This is the same as what I get after I changed a few tensor flow API calls in the code. How did you change the prettytensor code?

Thanks!

metatl avatar Jan 19 '18 03:01 metatl

@hope-yao Thanks for the tip. Tried it. Got some different errors. This time it is

Traceback (most recent call last): File "launchers/run_mnist_exp.py", line 65, in algo.train() File "/home/tianle/work/deep_learning/InfoGAN/infogan/algos/infogan_trainer.py", line 210, in train self.init_opt() File "/home/tianle/work/deep_learning/InfoGAN/infogan/algos/infogan_trainer.py", line 51, in init_opt z_var = self.model.latent_dist.sample_prior(self.batch_size) File "/home/tianle/work/deep_learning/InfoGAN/infogan/misc/distributions.py", line 443, in sample_prior return tf.concat(axis=1, values=ret) TypeError: concat() got an unexpected keyword argument 'axis'

This appears to be a tensorflow version issue, but I thought the point of your tip is to obtain a correct version of tensorflow and prettytensor?

Thanks.

metatl avatar Jan 19 '18 03:01 metatl

@metatl here's what you need to change in prettytensor: https://github.com/google/prettytensor/pull/57/files This is linked to in my fork's ReadMe.

zjost avatar Jan 19 '18 17:01 zjost