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

how to train ghostnet? #9

Open
gtfaiwxm opened this issue Mar 2, 2020 · 12 comments
Open

how to train ghostnet? #9

gtfaiwxm opened this issue Mar 2, 2020 · 12 comments

Comments

@gtfaiwxm
Copy link

gtfaiwxm commented Mar 2, 2020

how to train ghostnet in my dataset?

@iamhankai
Copy link
Member

I think you have the training example for your dataset. Just replace your network with GhostNet and train it.

@gtfaiwxm
Copy link
Author

gtfaiwxm commented Mar 2, 2020

OK,thanks

@JayFu
Copy link

JayFu commented Mar 13, 2020

OK,thanks

Hi , I was going to replace my network with Ghostnet but it keep throwing bug in tensorpack part.
This example works fine with MobileNetv2.
File "/media/e/hujiang/anaconda3/envs/tf/lib/python3.6/site-packages/tensorpack/models/batch_norm.py", line 176, in BatchNorm training = ctx.is_training AttributeError: 'NoneType' object has no attribute 'is_training'

Can you tell me how you handle it ?

@iamhankai
Copy link
Member

iamhankai commented Mar 14, 2020

What's the version of your tensorflow and tensorpack? I recommend TensorFlow-1.13.1, Tensorpack-0.9.7.

@JayFu
Copy link

JayFu commented Mar 14, 2020

What's the version of your tensorflow and tensorpack? I recommend TensorFlow-1.13.1, Tensorpack-0.9.7.

Oh thanks! I was using tf 1.5.0 and tensorpack 0.9.9 indeed.
But it seems doesn't work after attempt. Got the same error.
Guessing that's because my training example doesn't suit it?
Could tell me any recomending training example?

@ppwwyyxx
Copy link

You need https://tensorpack.readthedocs.io/tutorial/symbolic.html#use-models-outside-tensorpack

@iamhankai
Copy link
Member

Thanks @ppwwyyxx

@JayFu
Copy link

JayFu commented Mar 16, 2020

@ppwwyyxx TY

@KnightWin123
Copy link

@gtfaiwxm Have you known how to train the Ghostnet?

@PistonY
Copy link

PistonY commented Sep 28, 2020

Hi @iamhankai thanks for sharing this good work. I success training GhostNet 1.3x to 75.78/92.77 top1/top5, it's almost your paper mentioned. Details here
But I use the same training setting with I train MobileNetV3 with some tricks Label smoothing, No decay bias and Dropout.
I see your paper and reply in iamhankai/ghostnet.pytorch#18, it's seem that you don't use any tricks when training this. I've tried MobileNetV3 can't get such high accuracy leaving these tricks.
I wonder what tricks when training, if it's possible I remove these and get same result?

@iamhankai
Copy link
Member

@PistonY Thanks for you attention. We trained GhostNet using the tricks similar to MobileNetV3 paper, including Label smoothing, No decay bias and Dropout.

@ghost
Copy link

ghost commented Nov 11, 2020

from tensorpack import TowerContext
with TowerContext('', is_training=False):
    model = GhostNet(....)
    model.data_format = 'NHWC'
    image_tensor = tf.placeholder(dtype=np.float32, shape=(7, 320, 320, 3), name='image_tensor')
    logits = model.get_logits(image_tensor)
    print(logits)

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

6 participants