Code Monkey home page Code Monkey logo

Comments (10)

cardwing avatar cardwing commented on May 28, 2024

I have met the same problem. My solution is to not activate tensorflow in the terminal, i.e., not use "source activate tensorflow". Just use "python pspnet.py -m pspnet101_cityscapes -i example_images/cityscapes.png -o example_results/cityscapes.jpg", it will work.

from pspnet-keras-tensorflow.

Vladkryvoruchko avatar Vladkryvoruchko commented on May 28, 2024

@cardwing what do you mean activate tf in the terminal? I guess it is to import tf in the python shell?
@aliericcantona Can you please provide some logs or error stack, as well as packages version

from pspnet-keras-tensorflow.

qiuyinglin avatar qiuyinglin commented on May 28, 2024

@Vladkryvoruchko
i am running the same issue as @aliericcantona
i install this whole package in amazon EC2 machine, which has Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-1022-aws x86_64v)

and in terminal, i put command "source activate tensorflow_p36" to have the TensorFlow(+Keras2) with Python3 (CUDA 8) enviroment.

then i run python pspnet.py -m pspnet101_voc2012 -i example_images/pascal_voc.jpg -o example_results/pascal_voc.jpg

then i get the below error:

/home/ubuntu/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
Using TensorFlow backend.
/home/ubuntu/anaconda3/envs/tensorflow_p36/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: compiletime version 3.5 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.6
return f(*args, **kwds)
2018-01-19 07:39:58.963310: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
2018-01-19 07:39:59.046386: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:892] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2018-01-19 07:39:59.046732: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1030] Found device 0 with properties:
name: Tesla K80 major: 3 minor: 7 memoryClockRate(GHz): 0.8235
pciBusID: 0000:00:1e.0
totalMemory: 11.17GiB freeMemory: 11.10GiB
2018-01-19 07:39:59.046769: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1120] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: Tesla K80, pci bus id: 0000:00:1e.0, compute capability: 3.7)
Namespace(flip=False, id='0', input_path='example_images/pascal_voc.jpg', model='pspnet101_voc2012', multi_scale=False, output_path='our_example_results/pascal_voc.jpg', sliding=False)
Keras model & weights found, loading...
XXX lineno: 18, opcode: 0
Traceback (most recent call last):
File "pspnet.py", line 270, in
weights=args.model)
File "pspnet.py", line 149, in init
input_shape=input_shape, weights=weights)
File "pspnet.py", line 41, in init
self.model = model_from_json(file_handle.read())
File "/home/ubuntu/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/keras/models.py", line 349, in model_from_json
return layer_module.deserialize(config, custom_objects=custom_objects)
File "/home/ubuntu/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/keras/layers/init.py", line 55, in deserialize
printable_module_name='layer')
File "/home/ubuntu/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/keras/utils/generic_utils.py", line 143, in deserialize_keras_object
list(custom_objects.items())))
File "/home/ubuntu/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/keras/engine/topology.py", line 2517, in from_config
process_node(layer, node_data)
File "/home/ubuntu/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/keras/engine/topology.py", line 2474, in process_node
layer(input_tensors[0], **kwargs)
File "/home/ubuntu/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/keras/engine/topology.py", line 617, in call
output = self.call(inputs, **kwargs)
File "/home/ubuntu/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/keras/layers/core.py", line 663, in call
return self.function(inputs, **arguments)
File "/media/tatsch/DataSSD1/workspace/PSPNet-Keras-tensorflow/pspnet/layers_builder.py", line 18, in Interp
new_height, new_width = shape
SystemError: unknown opcode

how can i fix it? Thanks!

from pspnet-keras-tensorflow.

cardwing avatar cardwing commented on May 28, 2024

@Vladkryvoruchko , not use tf in the terminal is just not execute "source activate tensorflow". Just use "python file_name.py -m pspnet101_cityscapes -i example_images/cityscapes.png -o example_results/cityscapes.jpg" should work.

from pspnet-keras-tensorflow.

jmtatsch avatar jmtatsch commented on May 28, 2024

Apparently this issue is caused by the marshal serial format having changed a bit between Python 3.5 and 3.6 as discovered in keras-team/keras#9595 . Converting the weights from numpy with python 3.6 should work around it.

from pspnet-keras-tensorflow.

shokohigol avatar shokohigol commented on May 28, 2024

I have met the same problem. I use python 3.5 and tensorflow-gpu 1.14.0.
I don't understand "not use tf in the terminal is just not execute "source activate tensorflow"" from @cardwing.
how can i fix it?

from pspnet-keras-tensorflow.

cardwing avatar cardwing commented on May 28, 2024

Just use "python pspnet.py -m pspnet101_cityscapes -i example_images/cityscapes.png -o example_results/cityscapes.jpg".

from pspnet-keras-tensorflow.

raghuram-kukun avatar raghuram-kukun commented on May 28, 2024

@cardwing Could you please be clearer? The README.md asks us to run the file just the way you have mentioned. What does don't activate tensorflow in terminal mean?

from pspnet-keras-tensorflow.

nicpho avatar nicpho commented on May 28, 2024

from keras.backend.tensorflow_backend import tf as ktf for keras 2.3.1

from pspnet-keras-tensorflow.

mobiiin avatar mobiiin commented on May 28, 2024

im having the same issue. tensorflow-gpu 2.4 or 2.3 not sure and keras 2.4.3
from keras.backend.tensorflow_backend import tf as ktf doesn't work either
ps: tf.keras.backend worked on my system
move the tensorflow import to the upper line

from pspnet-keras-tensorflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.