Closed hemangjoshi37a closed 4 years ago
If you should import just keras
import keras
it'll work.
I don't know why but tensorflow keras is not working.
And you should from livelossplot.keras import PlotLossesCallback
model.fit callback = callbacks=[PlotLossesCallback()])
@hemangjoshi37a Coul you post the lines of code causing this error?
This is the code sir... @stared
model.compile(optimizer=keras.optimizers.adam(), loss='mean_squared_error',metrics=["accuracy"])
history=model.fit(x_train, y_train,validation_split=0.05, verbose=1, batch_size=1000, epochs=5,callbacks=[livelossplot.PlotLossesKeras(),WandbCallback()])
If you should import just keras
import keras
it'll work. I don't know why but tensorflow keras is not working. And you shouldfrom livelossplot.keras import PlotLossesCallback
model.fit callback =callbacks=[PlotLossesCallback()])
@kkanska I cant use keras instead of the tfkeras because it does not work with my other code. So it is not a option. But anyway sir thank you very much for replying.
@hemangjoshi37a Could you copy&paste all import lines (relevant to livelossplot, Keras and TensorFlow)?
I was still getting the error. Then I followed this -
I did import keras
Then changed the import statement
from livelossplot.tf_keras import PlotLossesCallback
to
from livelossplot.inputs.tf_keras import PlotLossesCallback
@megha-a7 Please show the full part with the import and versiona of TensorFlow and Keras.
If you use standalone keras,
you need to use livelossplot.keras
, not livelossplot.tf_keras
.
This error has started appearing after I upgraded my tensorflow version to 2.2