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;








0















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')









share|improve this question




























    0















    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')









    share|improve this question
























      0












      0








      0








      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')









      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 24 at 15:32









      hacker HDhacker HD

      156




      156






















          1 Answer
          1






          active

          oldest

          votes


















          0














          The problem was the time.time code did not have ().






          share|improve this answer























            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
            );



            );













            draft saved

            draft discarded


















            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









            0














            The problem was the time.time code did not have ().






            share|improve this answer



























              0














              The problem was the time.time code did not have ().






              share|improve this answer

























                0












                0








                0







                The problem was the time.time code did not have ().






                share|improve this answer













                The problem was the time.time code did not have ().







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 24 at 18:20









                hacker HDhacker HD

                156




                156





























                    draft saved

                    draft discarded
















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                    Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript