tensorflow.python.framework.errors_impl.InvalidArgumentError in python codeHow can I represent an 'Enum' in Python?Way to create multiline comments in Python?What is the Python 3 equivalent of “python -m SimpleHTTPServer”Using Python 3 in virtualenvWhy is “1000000000000000 in range(1000000000000001)” so fast in Python 3?Keras the simplest NN model: error in training.py with indicesTensorFlow: Neural Network accuracy always 100% on train and test setsPythonshell.parser error using npm python-shellHow to use Scikit Learn Wrapper around Keras Bi-directional LSTM ModelLSTM Nerual Network Input/Output dimensions error
Does an ice chest packed full of frozen food need ice?
How to translate “Me doing X” like in online posts?
Implement Homestuck's Catenative Doomsday Dice Cascader
From the list of 3-tuples, how can I select tuples which contain one for more nines?
Where does this pattern of naming products come from?
Movie about a boy who was born old and grew young
Why only the fundamental frequency component is said to give useful power?
Can you really not move between grapples/shoves?
How many times can you cast a card exiled by Release to the Wind?
How would a aircraft visually signal in distress?
2.8 is missing the Carve option in the Boolean Modifier
siunitx error: Invalid numerical input
Should an arbiter claim draw at a K+R vs K+R endgame?
Can an Eldritch Knight use Action Surge and thus Arcane Charge even when surprised?
Building a road to escape Earth's gravity by making a pyramid on Antartica
What are the peak hours for public transportation in Paris?
How to retract an idea already pitched to an employer?
Cause of continuous spectral lines
Translating 'Liber'
Did the first version of Linux developed by Linus Torvalds have a GUI?
Required to check-in in person at international layover airport
Version 2 - print new even-length arrays from two arrays
Question about JavaScript Math.random() and basic logic
Is it recommended against to open-source the code of a webapp?
tensorflow.python.framework.errors_impl.InvalidArgumentError in python code
How can I represent an 'Enum' in Python?Way to create multiline comments in Python?What is the Python 3 equivalent of “python -m SimpleHTTPServer”Using Python 3 in virtualenvWhy is “1000000000000000 in range(1000000000000001)” so fast in Python 3?Keras the simplest NN model: error in training.py with indicesTensorFlow: Neural Network accuracy always 100% on train and test setsPythonshell.parser error using npm python-shellHow to use Scikit Learn Wrapper around Keras Bi-directional LSTM ModelLSTM Nerual Network Input/Output dimensions error
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I was trying to add tensorboard to a sentdex tutorial, and got the error tensorflow.python.framework.errors_impl.InvalidArgumentError. I'm rather new to tensorflow so I don't know what's wrong.
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, LSTM
from tensorflow.keras.callbacks import TensorBoard
import time
NAME = f"MNIST-time.time"
mnist = tf.keras.datasets.mnist
tensorboard = TensorBoard(log_dir='logs/'.format(NAME))
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train = x_train/255
x_test = x_test/255
model = Sequential()
model.add(LSTM(128, input_shape=(x_train.shape[1:]), activation='relu', return_sequences=True))
model.add(Dropout(0.2))
model.add(LSTM(128, activation='relu'))
model.add(Dropout(0.2))
model.add(Dense(32, activation='relu'))
model.add(Dropout(0.2))
model.add(Dense(10, activation='softmax'))
opt = tf.keras.optimizers.Adam(lr=1e-3, decay=1e-5)
model.compile(loss='sparse_categorical_crossentropy', optimizer=opt, metrics=['accuracy'])
tensorboard = TensorBoard(log_dir=f'logs/NAME')
model.fit(x_train, y_train, epochs=2, validation_data=(x_test, y_test), callbacks = [tensorboard])
model.save('MNIST')
python-3.x tensorflow tf.keras
add a comment |
I was trying to add tensorboard to a sentdex tutorial, and got the error tensorflow.python.framework.errors_impl.InvalidArgumentError. I'm rather new to tensorflow so I don't know what's wrong.
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, LSTM
from tensorflow.keras.callbacks import TensorBoard
import time
NAME = f"MNIST-time.time"
mnist = tf.keras.datasets.mnist
tensorboard = TensorBoard(log_dir='logs/'.format(NAME))
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train = x_train/255
x_test = x_test/255
model = Sequential()
model.add(LSTM(128, input_shape=(x_train.shape[1:]), activation='relu', return_sequences=True))
model.add(Dropout(0.2))
model.add(LSTM(128, activation='relu'))
model.add(Dropout(0.2))
model.add(Dense(32, activation='relu'))
model.add(Dropout(0.2))
model.add(Dense(10, activation='softmax'))
opt = tf.keras.optimizers.Adam(lr=1e-3, decay=1e-5)
model.compile(loss='sparse_categorical_crossentropy', optimizer=opt, metrics=['accuracy'])
tensorboard = TensorBoard(log_dir=f'logs/NAME')
model.fit(x_train, y_train, epochs=2, validation_data=(x_test, y_test), callbacks = [tensorboard])
model.save('MNIST')
python-3.x tensorflow tf.keras
add a comment |
I was trying to add tensorboard to a sentdex tutorial, and got the error tensorflow.python.framework.errors_impl.InvalidArgumentError. I'm rather new to tensorflow so I don't know what's wrong.
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, LSTM
from tensorflow.keras.callbacks import TensorBoard
import time
NAME = f"MNIST-time.time"
mnist = tf.keras.datasets.mnist
tensorboard = TensorBoard(log_dir='logs/'.format(NAME))
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train = x_train/255
x_test = x_test/255
model = Sequential()
model.add(LSTM(128, input_shape=(x_train.shape[1:]), activation='relu', return_sequences=True))
model.add(Dropout(0.2))
model.add(LSTM(128, activation='relu'))
model.add(Dropout(0.2))
model.add(Dense(32, activation='relu'))
model.add(Dropout(0.2))
model.add(Dense(10, activation='softmax'))
opt = tf.keras.optimizers.Adam(lr=1e-3, decay=1e-5)
model.compile(loss='sparse_categorical_crossentropy', optimizer=opt, metrics=['accuracy'])
tensorboard = TensorBoard(log_dir=f'logs/NAME')
model.fit(x_train, y_train, epochs=2, validation_data=(x_test, y_test), callbacks = [tensorboard])
model.save('MNIST')
python-3.x tensorflow tf.keras
I was trying to add tensorboard to a sentdex tutorial, and got the error tensorflow.python.framework.errors_impl.InvalidArgumentError. I'm rather new to tensorflow so I don't know what's wrong.
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, LSTM
from tensorflow.keras.callbacks import TensorBoard
import time
NAME = f"MNIST-time.time"
mnist = tf.keras.datasets.mnist
tensorboard = TensorBoard(log_dir='logs/'.format(NAME))
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train = x_train/255
x_test = x_test/255
model = Sequential()
model.add(LSTM(128, input_shape=(x_train.shape[1:]), activation='relu', return_sequences=True))
model.add(Dropout(0.2))
model.add(LSTM(128, activation='relu'))
model.add(Dropout(0.2))
model.add(Dense(32, activation='relu'))
model.add(Dropout(0.2))
model.add(Dense(10, activation='softmax'))
opt = tf.keras.optimizers.Adam(lr=1e-3, decay=1e-5)
model.compile(loss='sparse_categorical_crossentropy', optimizer=opt, metrics=['accuracy'])
tensorboard = TensorBoard(log_dir=f'logs/NAME')
model.fit(x_train, y_train, epochs=2, validation_data=(x_test, y_test), callbacks = [tensorboard])
model.save('MNIST')
python-3.x tensorflow tf.keras
python-3.x tensorflow tf.keras
asked Mar 24 at 15:32
hacker HDhacker HD
156
156
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
The problem was the time.time code did not have ().
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55325420%2ftensorflow-python-framework-errors-impl-invalidargumenterror-in-python-code%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The problem was the time.time code did not have ().
add a comment |
The problem was the time.time code did not have ().
add a comment |
The problem was the time.time code did not have ().
The problem was the time.time code did not have ().
answered Mar 24 at 18:20
hacker HDhacker HD
156
156
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55325420%2ftensorflow-python-framework-errors-impl-invalidargumenterror-in-python-code%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown