aleguida

aleguida OP t1_itvhqg8 wrote

We should have 50% of the dataset as cats and 50% dogs.

​

  • Looks like a bug. The cross entropy loss in PyTorch seems incredibly out of line, as does the training-validation loss gap.

Good point. I need to double check that. What worries me more is the TF implementation that is struggling to get Ok results.

1

aleguida OP t1_itvhaee wrote

thanks for the feedback. Turning off the pretraining causes pytorch to learn more slowly (to be expected) but TF is stuck and not learning anything. See colabs notebooks below.

I see many other TF implementation adding a few more FC layers on the top of the VGG16 but as you also stated I would expect to see the same problem in pytorch while I am kind of getting different results with a similar network. I will try next to build a CNN from scratch using the very same layers for both frameworks

​

TF: https://colab.research.google.com/drive/1O6qzopiFzK5tDmLQAzLKmNoNaEMDc4Ze?usp=sharing
PYTORCH: https://colab.research.google.com/drive/1g-1CEpzmWJi9xOiZHzvDSv_-eDlXZO9u?usp=sharing

1

aleguida OP t1_itvgiu8 wrote

Thanks for the feedback. I tried retraining everything from scratch without downloading any pretrained weights. here is the colab links update.

​

While Pytorch is learning something, Tf is not learning anything. This is actually quite confusing as I used tf.Keras to minimize any possible error on my part. I will try to build the same network from scratch in both frameworks next

1