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

                    SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                    은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현