Test_results = model.evaluate(padded_inputs_test, y_test, verbose=False) History = model.fit(padded_inputs, y_train, batch_size=batch_size, epochs=number_of_epochs, verbose=verbosity_mode, validation_split=validation_split) pile(optimizer=optimizer, loss=loss_function, metrics=additional_metrics) Model.add(Dense(1, activation='sigmoid')) Model.add(Embedding(num_distinct_words, embedding_output_dims, input_length=max_sequence_length)) Padded_inputs_test = pad_sequences(x_test, maxlen=max_sequence_length, value = 0.0) # 0.0 because it corresponds with Padded_inputs = pad_sequences(x_train, maxlen=max_sequence_length, value = 0.0) # 0.0 because it corresponds with (x_train, y_train), (x_test, y_test) = imdb.load_data(num_words=num_distinct_words) It takes a ridiculously long time just for a single epoch.Ĭode needed for reproducing this behavior.įrom import imdbįrom import Embedding, Dense, LSTMįrom import Binar圜rossentropyįrom import Sequentialįrom import Adamįrom import pad_sequences I am trying to train a model on Macbook Pro M1, but the performance is so bad and the train doesn't work properly. Steps needed for installing Tensorflow with metal support. GPU model and memory: MacBook Pro M1 and 16 GB TensorFlow version (2.5 version) with Metal Support pile(optimizer='sgd', loss='mean_squared_error') 16:55:02.339241: I tensorflow/core/grappler/optimizers/custom_graph_optimizer_:112] Plugin optimizer for device_type GPU is enabled. 16:55:02.258033: W tensorflow/core/platform/profile_utils/cpu_:128] Failed to get CPU frequency: 0 Hz 16:55:02.257192: I tensorflow/compiler/mlir/mlir_graph_optimization_:176] None of the MLIR Optimization Passes are enabled (registered 2) Īnd other codes including fit() also can't work and faced the same error. Using the same codes on windows PC, I can get right results. When I fit the data, the loss didn't decrease.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |