Coder Social home page Coder Social logo

Comments (3)

pairwiserr avatar pairwiserr commented on June 9, 2024 1

Solution is to convert all your lists to numpy array
e.g.

import numpy as np
x = np.array(x_train_pad)
y = np.array(y_train)

model.fit(x, y, validation_split=0.06, epochs=3, batch_size=64)

Also when you're loading tensorflow keras packages on line 2, change

from tensorflow.python.keras.models import Sequential
from tensorflow.python.keras.layers import Dense, GRU, Embedding
from tensorflow.python.keras.optimizers import Adam
from tensorflow.python.keras.preprocessing.text import Tokenizer
from tensorflow.python.keras.preprocessing.sequence import pad_sequences

to

from tensorflow.compat.v1.keras.models import Sequential
from tensorflow.compat.v1.keras.layers import Dense, GRU, Embedding
from tensorflow.compat.v1.keras.optimizers import Adam
from tensorflow.compat.v1.keras.preprocessing.text import Tokenizer
from tensorflow.compat.v1.keras.preprocessing.sequence import pad_sequences

I think tf 2.0 broke some of the utility functions when calculating gradients.

from tensorflow-tutorials.

Hvass-Labs avatar Hvass-Labs commented on June 9, 2024 1

Your post is too short. I have to guess most of the context. Are you running the tutorial exactly like it is in the repo? Are you using another dataset? If you're running it exactly like it is in the repo, then it's perhaps a tensorflow 2.0 problem. At some point I will go through all the tutorials and see if I can update them to TF 2.0. Using compat.v1 is only a temporary fix.

from tensorflow-tutorials.

pairwiserr avatar pairwiserr commented on June 9, 2024

Sorry, I should've prefaced that I am running the notebook exactly as is, line by line, using the same dataset with your download.py and imdb.py.

from tensorflow-tutorials.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.