PSPNet-Keras-tensorflow
PSPNet-Keras-tensorflow copied to clipboard
from keras.backend import tf as ktf
from keras.backend import tf as ktf fails on keras.version = 2.0.8 therefore the interpolation layer gives an error.
Any solution?
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.
@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
@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
how can i fix it? Thanks!
@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.
Apparently this issue is caused by the marshal serial format having changed a bit between Python 3.5 and 3.6 as discovered in https://github.com/keras-team/keras/issues/9595 . Converting the weights from numpy with python 3.6 should work around it.
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?
Just use "python pspnet.py -m pspnet101_cityscapes -i example_images/cityscapes.png -o example_results/cityscapes.jpg".
@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 keras.backend.tensorflow_backend import tf as ktf for keras 2.3.1
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