matsui528 / sis

Simple image search engine

Home Page:http://yusukematsui.me/project/sis/sis.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

i have a problem.

GodEunhyuk opened this issue · comments

i have a problem.
Can you help me?

======================================================
(j16134uk) EUNHYUKui-MacBook-Pro:sis eunhyulkim$ python server.py
Using TensorFlow backend.
WARNING:tensorflow:From /Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:74: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.

WARNING:tensorflow:From /Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:517: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

WARNING:tensorflow:From /Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:4138: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

WARNING:tensorflow:From /Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:3976: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

WARNING:tensorflow:From /Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:174: The name tf.get_default_session is deprecated. Please use tf.compat.v1.get_default_session instead.

WARNING:tensorflow:From /Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:181: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.

2019-11-13 14:56:28.253959: I tensorflow/core/platform/cpu_feature_guard.cc:145] This TensorFlow binary is optimized with Intel(R) MKL-DNN to use the following CPU instructions in performance critical operations: SSE4.1 SSE4.2 AVX AVX2 FMA
To enable them in non-MKL-DNN operations, rebuild TensorFlow with the appropriate compiler flags.
2019-11-13 14:56:28.254322: I tensorflow/core/common_runtime/process_util.cc:115] Creating new thread pool with default inter op setting: 4. Tune using inter_op_parallelism_threads for best performance.

  • Serving Flask app "server" (lazy loading)
  • Environment: production
    WARNING: This is a development server. Do not use it in a production deployment.
    Use a production WSGI server instead.
  • Debug mode: off
  • Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
    127.0.0.1 - - [13/Nov/2019 14:56:46] "GET / HTTP/1.1" 200 -
    [2019-11-13 14:56:52,113] ERROR in app: Exception on / [POST]
    Traceback (most recent call last):
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functionsrule.endpoint
    File "server.py", line 30, in index
    query = fe.extract(img)
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/sis/feature_extractor.py", line 19, in extract
    feature = self.model.predict(x)[0] # (1, 4096) -> (4096, )
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/keras/engine/training.py", line 1164, in predict
    self._make_predict_function()
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/keras/engine/training.py", line 554, in _make_predict_function
    **kwargs)
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2744, in function
    return Function(inputs, outputs, updates=updates, **kwargs)
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2546, in init
    with tf.control_dependencies(self.outputs):
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 5426, in control_dependencies
    return get_default_graph().control_dependencies(control_inputs)
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 4867, in control_dependencies
    c = self.as_graph_element(c)
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3796, in as_graph_element
    return self._as_graph_element_locked(obj, allow_tensor, allow_operation)
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3875, in _as_graph_element_locked
    raise ValueError("Tensor %s is not an element of this graph." % obj)
    ValueError: Tensor Tensor("fc1/Relu:0", shape=(?, 4096), dtype=float32) is not an element of this graph.
    127.0.0.1 - - [13/Nov/2019 14:56:52] "POST / HTTP/1.1" 500 -

======================================================

Please clone the latest repository, update all packages, and run again. If there's still problems, let me know the version of (1) python, (2) tensorflow, and (3) keras,

Respectfully,
Thank you so much for your kindreply.

Although the module was updated several times,
It didn't go well.
(1) Python 3.6.9 :: Anaconda, Inc.
(2) tensorflow

tensorflow 1.15.0 mkl_py36h4920b83_0
tensorflow-base 1.15.0 mkl_py36he1670d9_0
tensorflow-estimator 1.15.1 pyh2649769_0

(3) keras,
keras 2.2.4 0
keras-applications 1.0.8 py_0
keras-base 2.2.4 py36_0
keras-preprocessing 1.1.0 py_1

The version of your tensorflow and keras is not latest. You should update tensorflow to 2.x. Current latest version would be:

$ pip list | grep tensorflow
tensorflow             2.0.0              
tensorflow-estimator   2.0.1   

$ pip list | grep Keras
Keras                  2.3.1              
Keras-Applications     1.0.8              
Keras-Preprocessing    1.1.0