Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PVT model not training.. #71

Open
ma7555 opened this issue Aug 23, 2022 · 0 comments
Open

PVT model not training.. #71

ma7555 opened this issue Aug 23, 2022 · 0 comments

Comments

@ma7555
Copy link

ma7555 commented Aug 23, 2022

Describe the bug
PVT model does not train.

To Reproduce
Steps to reproduce the behaviour:

import tfimm 
import tensorflow_datasets as tfds
import tensorflow as tf

def resize_normalize(x, y):
    x = tf.image.resize(x, (224, 224)) / 255
    return x, y

train_ds = tfds.load('imagenet_v2', 
               split='test', 
               as_supervised=True)
train_ds = train_ds.map(resize_normalize).batch(32)

model = tfimm.create_model("pvt_tiny", pretrained=None)

model.compile(optimizer=tf.keras.optimizers.Adam(1e-3), loss="sparse_categorical_crossentropy", metrics=["accuracy"])
model.fit(train_ds)
Epoch 1/5
313/313 [==============================] - 67s 187ms/step - loss: 15.6424 - accuracy: 6.0000e-04
Epoch 2/5
313/313 [==============================] - 60s 191ms/step - loss: 16.2130 - accuracy: 0.0010
Epoch 3/5
313/313 [==============================] - 60s 191ms/step - loss: 16.2144 - accuracy: 0.0010
Epoch 4/5
313/313 [==============================] - 60s 191ms/step - loss: 16.2418 - accuracy: 0.0010
Epoch 5/5
313/313 [==============================] - 60s 191ms/step - loss: 16.2417 - accuracy: 0.0010

Expected behaviour
Convergance of model

Desktop (please complete the following information):

  • OS: Windows 11
  • Repo version: 0.2.7
  • TensorFlow version with CUDA/cuDNN [e.g. TF 2.9.1 with CUDA 11.2]

Also note that setting the LR to 1e-4 as the paper does not solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant