All Questions
273 questions
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. ...
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....
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), ...
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 '...
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 ...
-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 ...
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 ...
0
votes
1
answer
347
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:
...
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-...
0
votes
0
answers
233
views
ImportError: cannot import name 'count_params' from 'keras.utils'
I am attempting to run the code below.
from DataGeneratorSimCLR import DataGeneratorSimCLR as DataGenerator
from SimCLR import SimCLR
I am getting the error...
ImportError: cannot import name '...
1
vote
2
answers
600
views
Import error in Google colab with keras_utils
ImportError Traceback (most recent call last)
<ipython-input-3-2e842b3b11e3> in <cell line: 32>()
30 from keras.preprocessing import image
31 import ...
0
votes
0
answers
43
views
Shape problem building a nn model with keras in model.fit() function
So I'm working on this code to build a nn with keras. My dataset is about breast cancer diagnosis and I have already done the preprocessing.
I am building the model, and everthing was fine until I got ...
1
vote
1
answer
322
views
Detected a call to `Model.fit` inside a `tf.function`. `Model.fit is a high-level endpoint that manages its own `tf.function`
I am facing an issue while trying to train an LSTM model using Keras in a Google Colaboratory notebook. The goal is to predict certain "unit1" outages ("moh") based on time series ...
0
votes
1
answer
2k
views
How do I fix an 'AttributeError: 'Sequential' object has no attribute 'predict_classes' in Python
I am running a program from a public colab for MNIST using keras library. I am unable to run this block of code. I attempted to import the new keras attributes, and updating TensorFlow. However I ...
-1
votes
1
answer
86
views
INVALID_ARGUMENT: Unknown image file format. One of JPEG, PNG, GIF, BMP required
I wrote a standard code and when I run this command ( model. fit) I have the error above.
I know that most of my dataset is in jpg format and jpg is not accepted by TensorFlow. My dataset is about ...