Comments (3)
@emanueledirosa Make sure you have TensorFlow 1.14. I had the same problem with different version of TensorFlow
from ktrain.
@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.
@emanueledirosa after loading the predictor, call predictor.model._make_predict_function()
from ktrain.
Related Issues (20)
- eli5 does not support scikit-learn>=1.3 HOT 2
- fix generative_qa imports HOT 1
- about ner tflite model HOT 1
- Bug with ktrain.text.translation HOT 7
- texts_from_df throws error AttributeError: 'NoneType' object has no attribute 'utils' HOT 2
- The initializer GlorotNormal is unseeded and being called multiple times, which will return identical values each time (even if the initializer is unseeded). HOT 3
- switch to textract-py3 HOT 1
- switch from chardet to charset-normalizer
- Unable to reload predictor : `model.compile` was created inside a different distribution strategy scope than the model HOT 1
- Is there a method to convert ktrain predictor to onnx model (optimized and quantized) without using transformers PyTorch dependencies HOT 2
- Any plans for supporting python 3.11? HOT 1
- Load model without training. HOT 1
- Ktrain on colab not working HOT 1
- predictor.explain() not working with inputs of type "$()" HOT 2
- Saved checkpoints not titled with descriptive information HOT 1
- Memory leak when using predict_filename in lambda function HOT 3
- Memory Leak with predictor.predict_proba in ktrain HOT 2
- remove `text.qa.generative_qa` module
- Could not interpret optimizer identifier HOT 5
- Overfitting Issue HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ktrain.