Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when running the example #12

Open
qjqjqjj opened this issue Apr 15, 2018 · 1 comment
Open

error when running the example #12

qjqjqjj opened this issue Apr 15, 2018 · 1 comment

Comments

@qjqjqjj
Copy link

qjqjqjj commented Apr 15, 2018

Hi,

I follow the post and installed the stuff that is needed for this example, however when I run it at jupyter it has the following error:


ImportError Traceback (most recent call last)
in ()
----> 1 from keras.layers import Input, Conv2D, Lambda, merge, Dense, Flatten,MaxPooling2D
2 from keras.models import Model, Sequential
3 from keras.regularizers import l2
4 from keras import backend as K
5 from keras.optimizers import SGD,Adam

/usr/local/lib/python2.7/site-packages/keras/init.py in ()
1 from future import absolute_import
2
----> 3 from . import utils
4 from . import activations
5 from . import applications

/usr/local/lib/python2.7/site-packages/keras/utils/init.py in ()
4 from . import data_utils
5 from . import io_utils
----> 6 from . import conv_utils
7
8 # Globally-importable utils.

/usr/local/lib/python2.7/site-packages/keras/utils/conv_utils.py in ()
7 from six.moves import range
8 import numpy as np
----> 9 from .. import backend as K
10
11

/usr/local/lib/python2.7/site-packages/keras/backend/init.py in ()
82 elif _BACKEND == 'tensorflow':
83 sys.stderr.write('Using TensorFlow backend.\n')
---> 84 from .tensorflow_backend import *
85 else:
86 raise ValueError('Unknown backend: ' + str(_BACKEND))

/usr/local/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py in ()
3 from future import print_function
4
----> 5 import tensorflow as tf
6 from tensorflow.python.training import moving_averages
7 from tensorflow.python.ops import tensor_array_ops

/usr/local/lib/python2.7/site-packages/tensorflow/init.py in ()
21 from future import print_function
22
---> 23 from tensorflow.python import *
24
25

/usr/local/lib/python2.7/site-packages/tensorflow/python/init.py in ()
47 _default_dlopen_flags = sys.getdlopenflags()
48 sys.setdlopenflags(_default_dlopen_flags | ctypes.RTLD_GLOBAL)
---> 49 from tensorflow.python import pywrap_tensorflow
50 sys.setdlopenflags(_default_dlopen_flags)
51

/usr/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py in ()
26 fp.close()
27 return _mod
---> 28 _pywrap_tensorflow = swig_import_helper()
29 del swig_import_helper
30 else:

/usr/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py in swig_import_helper()
22 if fp is not None:
23 try:
---> 24 _mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
25 finally:
26 fp.close()

ImportError: /usr/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so: undefined symbol: PyUnicodeUCS4_AsUTF8String

can someone do enlighten me? I just started learning using SiameseNet and jupyter so am not sure whats the error and how to slove it.

Thanks

@sorenbouma
Copy link
Owner

It looks like keras is having trouble importing tensorflow. Make sure you have a working version of tensorflow, installed on the same version of python(2 vs 3) you're using in the jupyter notebook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@sorenbouma @qjqjqjj and others