neural-style-tf icon indicating copy to clipboard operation
neural-style-tf copied to clipboard

AttributeError: 'module' object has no attribute 'computation'

Open ChoclateRain opened this issue 8 years ago • 4 comments

Input - python neural_style.py --content_img golden_gate.jpg --style_imgs starry-night.jpg --max_size 1280 --max_iterations 100 --device /gpu:0 --verbose

Output- (Click to reveal) ---- RENDERING SINGLE IMAGE ----

2017-06-28 16:05:00.908797: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations. 2017-06-28 16:05:00.908831: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations. 2017-06-28 16:05:00.908845: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations. 2017-06-28 16:05:00.908857: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations. 2017-06-28 16:05:00.908868: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations. 2017-06-28 16:05:01.152459: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:893] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2017-06-28 16:05:01.153529: I tensorflow/core/common_runtime/gpu/gpu_device.cc:940] Found device 0 with properties: name: GeForce GTX 1080 Ti major: 6 minor: 1 memoryClockRate (GHz) 1.6705 pciBusID 0000:23:00.0 Total memory: 10.91GiB Free memory: 10.17GiB 2017-06-28 16:05:01.153564: I tensorflow/core/common_runtime/gpu/gpu_device.cc:961] DMA: 0 2017-06-28 16:05:01.153575: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971] 0: Y 2017-06-28 16:05:01.153601: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1030] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 1080 Ti, pci bus id: 0000:23:00.0)

BUILDING VGG-19 NETWORK loading model weights... constructing layers... LAYER GROUP 1 --conv1_1 | shape=(1, 734, 979, 64) | weights_shape=(3, 3, 3, 64) --relu1_1 | shape=(1, 734, 979, 64) | bias_shape=(64,) --conv1_2 | shape=(1, 734, 979, 64) | weights_shape=(3, 3, 64, 64) --relu1_2 | shape=(1, 734, 979, 64) | bias_shape=(64,) --pool1 | shape=(1, 367, 490, 64) LAYER GROUP 2 --conv2_1 | shape=(1, 367, 490, 128) | weights_shape=(3, 3, 64, 128) --relu2_1 | shape=(1, 367, 490, 128) | bias_shape=(128,) --conv2_2 | shape=(1, 367, 490, 128) | weights_shape=(3, 3, 128, 128) --relu2_2 | shape=(1, 367, 490, 128) | bias_shape=(128,) --pool2 | shape=(1, 184, 245, 128) LAYER GROUP 3 --conv3_1 | shape=(1, 184, 245, 256) | weights_shape=(3, 3, 128, 256) --relu3_1 | shape=(1, 184, 245, 256) | bias_shape=(256,) --conv3_2 | shape=(1, 184, 245, 256) | weights_shape=(3, 3, 256, 256) --relu3_2 | shape=(1, 184, 245, 256) | bias_shape=(256,) --conv3_3 | shape=(1, 184, 245, 256) | weights_shape=(3, 3, 256, 256) --relu3_3 | shape=(1, 184, 245, 256) | bias_shape=(256,) --conv3_4 | shape=(1, 184, 245, 256) | weights_shape=(3, 3, 256, 256) --relu3_4 | shape=(1, 184, 245, 256) | bias_shape=(256,) --pool3 | shape=(1, 92, 123, 256) LAYER GROUP 4 --conv4_1 | shape=(1, 92, 123, 512) | weights_shape=(3, 3, 256, 512) --relu4_1 | shape=(1, 92, 123, 512) | bias_shape=(512,) --conv4_2 | shape=(1, 92, 123, 512) | weights_shape=(3, 3, 512, 512) --relu4_2 | shape=(1, 92, 123, 512) | bias_shape=(512,) --conv4_3 | shape=(1, 92, 123, 512) | weights_shape=(3, 3, 512, 512) --relu4_3 | shape=(1, 92, 123, 512) | bias_shape=(512,) --conv4_4 | shape=(1, 92, 123, 512) | weights_shape=(3, 3, 512, 512) --relu4_4 | shape=(1, 92, 123, 512) | bias_shape=(512,) --pool4 | shape=(1, 46, 62, 512) LAYER GROUP 5 --conv5_1 | shape=(1, 46, 62, 512) | weights_shape=(3, 3, 512, 512) --relu5_1 | shape=(1, 46, 62, 512) | bias_shape=(512,) --conv5_2 | shape=(1, 46, 62, 512) | weights_shape=(3, 3, 512, 512) --relu5_2 | shape=(1, 46, 62, 512) | bias_shape=(512,) --conv5_3 | shape=(1, 46, 62, 512) | weights_shape=(3, 3, 512, 512) --relu5_3 | shape=(1, 46, 62, 512) | bias_shape=(512,) --conv5_4 | shape=(1, 46, 62, 512) | weights_shape=(3, 3, 512, 512) --relu5_4 | shape=(1, 46, 62, 512) | bias_shape=(512,) --pool5 | shape=(1, 23, 31, 512) Traceback (most recent call last): File "neural_style.py", line 872, in main() File "neural_style.py", line 869, in main else: render_single_image() File "neural_style.py", line 838, in render_single_image stylize(content_img, style_imgs, init_img) File "neural_style.py", line 597, in stylize optimizer = get_optimizer(L_total) File "neural_style.py", line 638, in get_optimizer optimizer = tf.contrib.opt.ScipyOptimizerInterface( File "/home/poop/anaconda2/lib/python2.7/site-packages/tensorflow/python/util/lazy_loader.py", line 53, in getattr module = self._load() File "/home/poop/anaconda2/lib/python2.7/site-packages/tensorflow/python/util/lazy_loader.py", line 42, in _load module = importlib.import_module(self.name) File "/home/poop/anaconda2/lib/python2.7/importlib/init.py", line 37, in import_module import(name) File "/home/poop/anaconda2/lib/python2.7/site-packages/tensorflow/contrib/init.py", line 31, in from tensorflow.contrib import factorization File "/home/poop/anaconda2/lib/python2.7/site-packages/tensorflow/contrib/factorization/init.py", line 24, in from tensorflow.contrib.factorization.python.ops.gmm import * File "/home/poop/anaconda2/lib/python2.7/site-packages/tensorflow/contrib/factorization/python/ops/gmm.py", line 27, in from tensorflow.contrib.learn.python.learn.estimators import estimator File "/home/poop/anaconda2/lib/python2.7/site-packages/tensorflow/contrib/learn/init.py", line 88, in from tensorflow.contrib.learn.python.learn import * File "/home/poop/anaconda2/lib/python2.7/site-packages/tensorflow/contrib/learn/python/init.py", line 23, in from tensorflow.contrib.learn.python.learn import * File "/home/poop/anaconda2/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/init.py", line 25, in from tensorflow.contrib.learn.python.learn import estimators File "/home/poop/anaconda2/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/init.py", line 297, in from tensorflow.contrib.learn.python.learn.estimators.dnn import DNNClassifier File "/home/poop/anaconda2/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/dnn.py", line 30, in from tensorflow.contrib.learn.python.learn.estimators import dnn_linear_combined File "/home/poop/anaconda2/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py", line 31, in from tensorflow.contrib.learn.python.learn.estimators import estimator File "/home/poop/anaconda2/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 49, in from tensorflow.contrib.learn.python.learn.learn_io import data_feeder File "/home/poop/anaconda2/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/learn_io/init.py", line 21, in from tensorflow.contrib.learn.python.learn.learn_io.dask_io import extract_dask_data File "/home/poop/anaconda2/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/learn_io/dask_io.py", line 26, in import dask.dataframe as dd File "/home/poop/anaconda2/lib/python2.7/site-packages/dask/dataframe/init.py", line 3, in from .core import (DataFrame, Series, Index, _Frame, map_partitions, File "/home/poop/anaconda2/lib/python2.7/site-packages/dask/dataframe/core.py", line 38, in pd.computation.expressions.set_use_numexpr(False)

AttributeError: 'module' object has no attribute 'computation'


Whats going on? It seems to of found my gpu, i have all the requirements installed, other implemations of neural style have been working, i tried setting the device to /cpu:0 and im getting the same error Note i am using the latest version of tensorflow-gpu Also tried leaving out the --device argument, same error

ChoclateRain avatar Jun 28 '17 20:06 ChoclateRain

Can you try the Adam optimizer and let me know if the same error happens?

cysmith avatar Jul 03 '17 19:07 cysmith

@cysmith It works using the adam optimizer Im not sure why lbfg throws that error, Can anyone else replicate this error? i can use it successfully in other implemations, gpu memory shouldnt be the problem theres 11gb to use

Edit: Just kept an eye on gpu mem it goes up to 10gb right before it crashes so for some reason it is using an abnormally large amount of gpu probably memory more than 11gb Adjusted the --max_size to 640 and tried with 320 aswell Still gpu mem goes past 10gb

Using the latest cuda, cudnn, tensorflow 1.2.0, all that Is anyone else getting this with lbfgs?

ChoclateRain avatar Jul 03 '17 23:07 ChoclateRain

@cysmith It seems even the adam optimizer is using around 10gb! :scream: But works O_o

ChoclateRain avatar Jul 03 '17 23:07 ChoclateRain

I also got similar error : AttributeError: module 'pandas.core.computation' has no attribute 'expressions'. Adding the traceback : Traceback (most recent call last): File "neural_style.py", line 858, in main() File "neural_style.py", line 855, in main else: render_single_image() File "neural_style.py", line 824, in render_single_image stylize(content_img, style_imgs, init_img) File "neural_style.py", line 583, in stylize optimizer = get_optimizer(L_total) File "neural_style.py", line 624, in get_optimizer optimizer = tf.contrib.opt.ScipyOptimizerInterface( File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/tensorflow/python/util/lazy_loader.py", line 53, in getattr module = self._load() File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/tensorflow/python/util/lazy_loader.py", line 42, in _load module = importlib.import_module(self.name) File "/home/ubuntu/anaconda3/lib/python3.6/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 955, in _find_and_load_unlocked File "", line 665, in _load_unlocked File "", line 678, in exec_module File "", line 219, in _call_with_frames_removed File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/init.py", line 31, in from tensorflow.contrib import factorization File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/factorization/init.py", line 24, in from tensorflow.contrib.factorization.python.ops.gmm import * File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/factorization/python/ops/gmm.py", line 27, in from tensorflow.contrib.learn.python.learn.estimators import estimator File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/init.py", line 88, in from tensorflow.contrib.learn.python.learn import * File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/init.py", line 23, in from tensorflow.contrib.learn.python.learn import * File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/init.py", line 25, in from tensorflow.contrib.learn.python.learn import estimators File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/estimators/init.py", line 297, in from tensorflow.contrib.learn.python.learn.estimators.dnn import DNNClassifier File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/estimators/dnn.py", line 30, in from tensorflow.contrib.learn.python.learn.estimators import dnn_linear_combined File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py", line 31, in from tensorflow.contrib.learn.python.learn.estimators import estimator File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 49, in from tensorflow.contrib.learn.python.learn.learn_io import data_feeder File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/learn_io/init.py", line 21, in from tensorflow.contrib.learn.python.learn.learn_io.dask_io import extract_dask_data File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/learn_io/dask_io.py", line 26, in import dask.dataframe as dd File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/dask/dataframe/init.py", line 3, in from .core import (DataFrame, Series, Index, _Frame, map_partitions, File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/dask/dataframe/core.py", line 40, in pd.core.computation.expressions.set_use_numexpr(False) AttributeError: module 'pandas.core.computation' has no attribute 'expressions'`

abhinav3 avatar Nov 23 '18 05:11 abhinav3