sadeepj / crfasrnn_keras

CRF-RNN Keras/Tensorflow version
http://crfasrnn.torr.vision
MIT License
603 stars 169 forks source link

demo run error #70

Closed jeremykid closed 4 years ago

jeremykid commented 5 years ago

Here is my error message.

Traceback (most recent call last):
  File "run_demo.py", line 48, in <module>
    main()
  File "run_demo.py", line 38, in main
    model = get_crfrnn_model_def()
  File "./src/crfrnn_model.py", line 111, in get_crfrnn_model_def
    name='crfrnn')([upscore, img_input])
  File "/Users/ws/anaconda3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py", line 75, in symbolic_fn_wrapper
    return func(*args, **kwargs)
  File "/Users/ws/anaconda3/lib/python3.7/site-packages/keras/engine/base_layer.py", line 463, in __call__
    self.build(unpack_singleton(input_shapes))
  File "./src/crfrnn_layer.py", line 67, in build
    trainable=True)
  File "/Users/ws/anaconda3/lib/python3.7/site-packages/keras/engine/base_layer.py", line 279, in add_weight
    weight = K.variable(initializer(shape, dtype=dtype),
TypeError: _diagonal_initializer() got an unexpected keyword argument 'dtype'
jinyl777 commented 5 years ago

do you deal it ? i meet it too

Xl-wj commented 4 years ago

I meet it too. tf or keras version problem?

sadeepj commented 4 years ago

@jeremykid @jinyl777 @Xl-wj Can you try changing line 32 and line 36 of https://github.com/sadeepj/crfasrnn_keras/blob/master/src/crfrnn_layer.py as shown below?

Line 32: def _diagonal_initializer(shape, *args, **kwargs):
....
Line 36: def _potts_model_initializer(shape, *args, **kwargs):
Xl-wj commented 4 years ago

@sadeepj Thank you! It works after changing the these codes .

sadeepj commented 4 years ago

@Xl-wj Thanks for the update. I have now pushed this change to the master branch (4d28dfe892ff3ff2cb9531130f081cde0fc236bc). Hence closing the ticket.

Hui-Yao commented 4 years ago

@jeremykid @jinyl777 @Xl-wj Can you try changing line 32 and line 36 of https://github.com/sadeepj/crfasrnn_keras/blob/master/src/crfrnn_layer.py as shown below?

Line 32: def _diagonal_initializer(shape, *args, **kwargs):
....
Line 36: def _potts_model_initializer(shape, *args, **kwargs):

sorry,i have the same problem,can you tell how should i solve it?thanks!

TF_INC=$(python -c 'import tensorflow as tf; print(tf.sysconfig.get_include())') TF_LIB=$(python -c 'import tensorflow as tf; print(tf.sysconfig.get_lib())')

g++ -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0 -shared high_dim_filter.cc modified_permutohedral.cc -o high_dim_filter.so -fPIC -I $TF_INC -I$TF_INC/external/nsync/public/ -L$TF_LIB -ltensorflow_framework -O2 There is no problem in compiling, but when I run the train.py code, I will get an error. undefined symbol: _ZTIN10tensorflow8OpKernelE @ sadeepj @hassanrazakhalid @sirotenko @Kautenja Thanks a lot!!!