Relative Content

Tag Archive for pythontensorflowkeras

Slowness when training multiple Keras models within a for loop

I am training several Keras models inside a for loop. When the train starts, each epoch takes around 280ms. But as trains go on, each epoch lasts around 3s. I have tried to solve this problem using clear_session(), but nothing changed. I also have tried to delete the model when it finishes the .fit and also use gc.collect(), but none worked.

tensorflow and keras on vscode on mac with python

I’m trying to get tensorflow.keras.layers to work on VSCode but everything I try does not seem to work and I keep getting a warning saying that Import “tensorflow.keras.layers” could not be resolved Pylance. I’ve made a virtual environment and pip installed both tensorflow and keras and it tells me requirement already satisfied. I’m not really sure what to do. I have tensorflow version 2.17.0 and keras 3.4.1. I’ve seen questions similar to my problem on here but they haven’t really helped me. I’m also on a Mac though I’m not sure if that changes anything.