I have this issue when I process the text. Do you know how to fix it. I just use pip install keras.
This is a generic Python/Pickle issue, not a Keras issue.
You can set tokenizer.oov_token = None to fix this.
The error was report in github comment
Related
I am very new to pytorch, and when I try to run my CNN, I encountered the Error:
AttributeError: module 'torch' has no attribute 'inference_mode'.
Does anyone know what is going one? It worked on Google colab but no where else.
Try bump the version to 1.13. Reference: https://pytorch.org/docs/stable/generated/torch.inference_mode.html
Most likely its a version issue.
torch.inference_mode() was added recently in v1.9. Make sure you have the correct version.
Try printing torch.__version__ to check your version.
I've been trying to run the GluonCV tutorial for action recognition.
I didn't modify anything, but I'm getting an error at the very beginning of the script, when applying the transformation function to the image.
The error is:
AttributeError: 'list' object has no attribute 'shape'
To try and solve it, I wanted to replace the list with a single image, so I tried:
img = transform_fn(img.asnumpy())
plt.imshow(np.transpose(img, (1,2,0)))
plt.show()
but in this case, I get another error:
TypeError: Image data of dtype object cannot be converted to float
Any idea on how to fix it?
Thanks!
It seems I had to update gluoncv to a later version.
A little weird, because I installed it following the instruction on the tutorial page, but it works after the update.
I'm getting this error when i use the tensorboard callback while training.
I tried looking for answers from posts related to tensorboard errors but this exact error was not found in any stackoverflow posts or github issues.
Please let know.
The following versions are installed in my pc:
Tensorflow and Tensorflow GPU : 2.0.0
Tensorboard: 2.0.0
I had the same problem and fixed it with this hack
model._get_distribution_strategy = lambda: None
It seems to be a bug on tensorflow's side.
https://github.com/tensorflow/tensorflow/pull/34870
Remove tensorboard callback for now.
This error mostly happens because of mixed imports from keras and tf.keras. Make sure that throughout the code exact referencing of libraries is maintained. For example instead of model.add(Conv2d()) try model.add(tf.keras.layers.Conv2D()) , applying this for all layers solved the problem for me.
I am using Tensorflow version 1.3.0 and Tensorboard (0.1.8), and when I am using tf.placeholder(), tf.GLOBAL_VARIABLES() or tf.global_variables_initializer, it get an error like the one in the title. I know that there is an update in the function's syntax for this version, but I can't find what is wrong.
Can anyone help me?
accuracy = tf.streaming_accuracy (y_pred,y_true,name='acc')
recall = tf.streaming_recall (y_pred,y_true,name='acc')
precision = tf.streaming_precision(y_pred,y_true,name='acc')
confusion = tf.confuson_matrix(Labels, y_pred,num_classes=10,dtype=tf.float32,name='conf')
For the above code, I have received the same error in past few days.
Isn't the syntax same as it is in the API documentation for tensorflow?
try to use this instead (in a fresh python file, I would suggest create a /tmp/temp.py and run that)
from tensorflow.contrib.metrics import streaming_accuracy
and if this doesn't work then
either there is an installation problem (In which case reinstall)
or you are importing the wrong tensorflow module.