Giter Site home page Giter Site logo

load predictor issue about ktrain HOT 3 CLOSED

amaiya avatar amaiya commented on June 15, 2024 2
load predictor issue

from ktrain.

Comments (3)

njofce avatar njofce commented on June 15, 2024

@emanueledirosa Make sure you have TensorFlow 1.14. I had the same problem with different version of TensorFlow

from ktrain.

emanueledirosa avatar emanueledirosa commented on June 15, 2024

@njofce thanks this solved the issue about the loading of the predictor. But it shows another issue now while making the prediction.
Any ideas? The same code works well on colab.

pred = predictor.predict([query])
File "/home/xxxxx/.local/lib/python3.6/site-packages/ktrain/text/predictor.py", line 48, in predict
preds = self.model.predict(texts)
File "/home/xxxxx/.local/lib/python3.6/site-packages/keras/engine/training.py", line 1164, in predict
self._make_predict_function()
File "/home/xxxxx/.local/lib/python3.6/site-packages/keras/engine/training.py", line 554, in _make_predict_function
**kwargs)
File "/home/xxxxx/.local/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2744, in function
return Function(inputs, outputs, updates=updates, **kwargs)
File "/home/xxxxx/.local/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2546, in init
with tf.control_dependencies(self.outputs):
File "/home/xxxxx/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 5426, in control_dependencies
return get_default_graph().control_dependencies(control_inputs)
File "/home/xxxxx/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 4867, in control_dependencies
c = self.as_graph_element(c)
File "/home/xxxxx/.local/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 "/home/xxxxx/.local/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("dense_1/Softmax:0", shape=(?, 698), dtype=float32) is not an element of this graph.

from ktrain.

njofce avatar njofce commented on June 15, 2024

@emanueledirosa after loading the predictor, call predictor.model._make_predict_function()

from ktrain.

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.