¡Esta es una revisión vieja del documento!
import tensorflow as tf tf.config.list_physical_devices()
from tensorflow.python.client import device_lib device_lib.list_local_devices()
device=device_lib.list_local_devices()[0] with tf.device(device.name): history=model.fit(x, y,epochs=epochs,verbose=False)
poetry config virtualenvs.in-project true poetry config --list #se debe instalar siempre esta dependencia poetry add ipykernel #instalar poetry install #ejecutar código python poetry run python my_script.py