Comments (16)
Use the nightly build:
pip install tf-nightly
from keras-io.
Following the problem. I also installed tf-nightly, but still showing
AttributeError: module 'tensorflow_core.keras.preprocessing' has no attribute 'timeseries_dataset_from_array'
from keras-io.
Hi Team,
I am also having same issue, while running the example in tensorflow tutorials "Basic text classification" under "ML basics with Keras".
Traceback (most recent call last):
File "main.py", line 77, in
text_classification()
File "main.py", line 71, in text_classification
load_dataset(train_dir)
File "main.py", line 29, in load_dataset
raw_train_ds = tf.keras.preprocessing.text_dataset_from_directory(
AttributeError: module 'tensorflow.keras.preprocessing' has no attribute 'text_dataset_from_directory'
tensorflow version = 2.2.0
Python version = 3.6.9
I tried installing tf-nightly also. But it did not solve the issue.
Any more pointers to fix this issue.
from keras-io.
try tensorflow 2.3.0, that one contains text_dataset_from_directory ... at least on Windows
from keras-io.
I have solved this problem by pip install tf-nightly
. If you did it but it ditn't take effect, you should restart your IDE or Jupyter notebook. I hope this comment is helpful for you!
from keras-io.
If you facing this problem now, upgrade to tensorflow 2.3.x. Also note that tf-nightly breaks your horovod.
from keras-io.
Same issue, tf-2.3.1
from keras-io.
FOR PEOPLE USING DOCKER TF FOR WSL2 and dont want to update their image:
- Go to https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/preprocessing
- Download datasets_utils.py and text_dataset.py
- make them as a module and call them within your project.
Note: text_datasets.py calls functions from datasets_utils.py. So you have to update the text_datasets.py file (Line 23) and make it import the datasets_utils.py properly.
from keras-io.
Use the nightly build:
pip install tf-nightly
After installing the nightly build in Kaggle, it still fails with no module found! Yet it works out of the box in Colab, why do we have all these inconsistencies? And how exactly can I use the image-dataset-from-directory function in Kaggle?
Has anyone successfully tried this in Kaggle?
Please I need to know urgently.
from keras-io.
Use the nightly build:
pip install tf-nightly
Thanks, but this didn't work for me.
I solved the problem with upgrading the TensorFlow, you may go with:
pip install --upgrade tensorflow
from keras-io.
pip install tf-nightly
RESTART
worked for me.
from keras-io.
I have created environment via "conda create workspace"
There I installed all necessary packages via conda, where tensorflow2.0.0 installed.
while importing
from Tensorflow.keras.layers import TextVectorization giving me import error that can not import TextVectorization and I'm getting the following error:
AttributeError: module 'tensorflow.keras.preprocessing' has no attribute 'image_dataset_from_directory'
when trying to solve: https://github.com/keras-team/keras-io/blob/master/examples/vision/image_classification_from_scratch.py
my TensorFlow version: 2.0.0
python version: 3.7.12
I tried pip3 install tf-nightly: got error zsh: illegal hardware instruction and module "tensorflow not found".
please help.
from keras-io.
Try with
keras.preprocessing.image_dataset.image_dataset_from_directory(
from keras-io.
Try using
tf.keras.applications.vgg16.preprocess_input(X, Dtype)
tf.keras.applications.resnet50.preprocess_input(x, data_format=None)
from keras-io.
make sure you are importing keras from tensorflow
import tensorflow as tf
from tensorflow import keras
from keras-io.
make sure you are importing keras from tensorflow
import tensorflow as tf from tensorflow import keras
This answer works for me.
my version is:
tf.version = '2.12.0'
keras.version = '2.12.0'
from keras-io.
Related Issues (20)
- Support Distributed Training for Fine-tuning Stable Diffusion Example HOT 5
- kagglecatsanddogs_5340.zip not available to downoad - image_classification_from_scratch.py HOT 4
- Problem with training yolov8 on TPU
- model not converging the sparse categorical accuracy stays same for the whole epochs. HOT 6
- batch out of range & loss value becomes 'nan' when running monocular depth estimation HOT 6
- How to make individual predictions using the FNet example? HOT 4
- Multi-GPU distributed training with PyTorch
- [Movielens Example] Impossibile to save model: Cannot serialize object Ellipsis HOT 4
- TypeError: Sampler.__call__() got an unexpected keyword argument 'end_token_id' HOT 2
- ValueError: The filepath provided must end in `.keras` (Keras model format). Received: filepath=Model_ckpt.h5 HOT 10
- Hardware requirement for examples/rl/deep_q_network_breakout.py? HOT 5
- bayesian_neural_networks failed with Mixed Precision enabled HOT 3
- Would it be possible to make lstm_seq2seq support mixed precision? HOT 1
- Will it be a good Idea to add a tutorial to train a Image Classification suing ViT using CLS token. HOT 2
- Cannot export a slightly customized XLMRoberta model from keras_nlp HOT 1
- tutorial bug in consistency_training HOT 4
- Help runing the lastest version of ".\examples\vision\captcha_ocr.py" HOT 1
- Timeseries Classification Transformer: Last -> First HOT 4
- GTP miniature model don't load. HOT 4
- StableDiffusion example doesn't currently work without adjustment
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 keras-io.