fchollet / deep-learning-with-python-notebooks

Jupyter notebooks for the code samples of the book "Deep Learning with Python"
MIT License
18.59k stars 8.63k forks source link

Chapter 8.2 convnet model (dogs vs cats) test accuracy can not achieve 83.5% as described in the book #235

Open shenchenbing opened 6 months ago

shenchenbing commented 6 months ago

<Deep Learning with Python 2nd Edition> Chapter 8.2 using a convnet model with data augmentation and dropout to classify images of dogs and cats. The book says that the test accuracy is 83.5% but I tried many times, using same model/code and same inputs but got all test accuracy results below 80%. Can anyone try those codes and get results around 83.5%? Or is the book description not correct?

WalkCharlie commented 2 months ago

callbacks = [ keras.callbacks.ModelCheckpoint( filepath="convnet_from_scratch.keras", save_best_only=True, monitor="val_loss") ] history = model.fit( train_dataset, epochs=30, validation_data=validation_dataset, callbacks=callbacks)这步模型训练报错,input arguments看不出来问题

shenchenbing commented 2 months ago

callbacks = [ keras.callbacks.ModelCheckpoint( filepath="convnet_from_scratch.keras", save_best_only=True, monitor="val_loss") ] history = model.fit( train_dataset, epochs=30, validation_data=validation_dataset, callbacks=callbacks)这步模型训练报错,input arguments看不出来问题

具体是报了什么错? 我倒是没碰到报错的情况,就是自己跑出来的测试精度和书里面有一些差异。

WalkCharlie commented 2 months ago

改成不用GPU就不报错。发自我的 iPhone在 2024年7月24日,14:33,shenchenbing @.***> 写道:

callbacks = [ keras.callbacks.ModelCheckpoint( filepath="convnet_from_scratch.keras", save_best_only=True, monitor="val_loss") ] history = model.fit( train_dataset, epochs=30, validation_data=validation_dataset, callbacks=callbacks)这步模型训练报错,input arguments看不出来问题

具体是报了什么错? 我倒是没碰到报错的情况,就是自己跑出来的测试精度和书里面有一些差异。

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>