Skip to main content

All Questions

-1 votes
1 answer
94 views

ResNet50 on TPU calculates NaN for accuracy and loss, works fine on CPU in Google Colab

I've trained a ResNet50 on v2-8 TPU accelerator using google colab, I've fed it with 5000 images of shape (224, 224, 3). I've normalized them, no nans, no inf, no class imbalance and everything is ...
احمد القيسي's user avatar
0 votes
0 answers
71 views

Google colab No DNN in stream executor for tensorflow keras with T4 GPu

The code import tensorflow as tf import numpy as np # Check and enable GPU if available if tf.config.list_physical_devices('GPU'): print("GPU is available and enabled.") else: print(...
Its Lol's user avatar
1 vote
1 answer
58 views

Why does pre-trained Swin Transformer encoder fail on TPU but works on CPU in Colab?

I’m working on an image segmentation task and trying to use a pre-trained Swin Transformer Large (Swin-L) encoder for the feature extraction backbone. The code runs perfectly on a CPU in Colab. ...
Omar Kamel's user avatar
0 votes
1 answer
48 views

Trouble loading the celebA dataset for vgg16 model

Im trying to use the celeba dataset for a vgg16 model, however when I try to run this code import tensorflow as tf from tensorflow.keras.preprocessing.image import ImageDataGenerator from tensorflow....
Jasmine 's user avatar
0 votes
1 answer
240 views

How to use loaded data from kaggle in google colab( to actually work with it)

So i recently imported dataset from this https://www.kaggle.com/datasets/mostafaabla/garbage-classification website. And even though i have it in my files in google colab(unzipped and all that stuff), ...
Uais Amangeldi's user avatar
1 vote
1 answer
342 views

AttributeError in TCN Layer when Building Model on Google Colab: 'tuple' object has no attribute 'as_list'

I am doing a project that needs to use Temporal Convolutional Network and I found a package that supports building this conveniently: https://github.com/philipperemy/keras-tcn Below is the code that I ...
TheMetaSetter's user avatar
0 votes
1 answer
345 views

I cannot load trained model in Google Colab TPU - error caused by batch_shape

I am using notebooks in Kaggle and Google Colab. After I trained my model in Kaggle (GPU P100) and tried to load it in Colab (TPU) I received this error: TypeError: Error when deserializing class '...
Radek's user avatar
  • 67
0 votes
0 answers
1k views

module 'keras.backend' has no attribute 'int_shape' in Keras 3

TensorFlow v.2.17.0 Keras v.3.4.1 Since Colab updated the libraries, I have been working towards making my code Keras 3 compliant. This is the error I am getting: AttributeError ...
Errol's user avatar
  • 1
0 votes
0 answers
241 views

Error loading kera model ValueError: Could not interpret initializer identifier: {'module': 'keras.initializers', 'class_name': 'Orthogonal'

I've created an ltsm model in Colab and want to use that locally. In colab: model.save("my_model.keras") And then locally my script is: from keras.models import load_model model_2 = ...
elksie5000's user avatar
  • 7,802
-1 votes
1 answer
297 views

How can I solve "No file or directory found at ./my_model/model.h5" thrown by tf.keras.models.load_model?

I created a code that tells if a picture of a wave is a raging wave when I enter it into the code. The code is shown below. pip install tensorflow opencv-python import os import cv2 import numpy as ...
user25260259's user avatar
0 votes
0 answers
268 views

TensorFlow Federated (TFF) Compatibility with Python 3.10.x and TensorFlow 2.14.0

I am currently working with TensorFlow 2.14.0 and Python 3.10.x and I am looking to integrate TensorFlow Federated (TFF) into my project. However, I am unsure about the compatibility of TFF with this ...
ATI. MALIK's user avatar
1 vote
2 answers
352 views

Google Colab: error when importing TFBertModel

I have an error in Google Colab when importing TFBertModel, two months before everything worked fine. from transformers import TFBertModel I receive: AttributeError ...
Nata107's user avatar
  • 55
0 votes
1 answer
346 views

TPU Connectivity Issue Training TF Model Google Colab

I have built a working Tensorflow neural network model on CPUs and GPUs. I am now trying to get the model to train on TPUs due to the large datasets. I have initialised the TPU strategy as usual: ...
Arnav Agarwal's user avatar
0 votes
1 answer
10k views

cannot import name 'ops' from 'keras'

I am trying to run this example Colab notebook from Keras.io, but When I run the first cell (imports section) I get ImportError: cannot import name 'ops' from 'keras' (/usr/local/lib/python3.10/dist-...
Mahsa's user avatar
  • 49
0 votes
0 answers
24 views

add_10 layer missing within resnet50 model error

My code had a get_layer command with the layer being add_10 which seems to now be gone from resnet50 ValueError Traceback (most recent call last) <ipython-input-11-...
Jacob A's user avatar
  • 11

15 30 50 per page
1
2 3 4 5
34