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

Can anyone explain why model loading fails when I try 'archead' while it works with 'normhead' during custom training with16 classes #27

Open
lastsupper108 opened this issue Dec 18, 2020 · 2 comments

Comments

@lastsupper108
Copy link

ValueError: Shapes (512, 16) and (512, 85742) are incompatible

@lastsupper108 lastsupper108 changed the title Can anyone explain why model loading fails when I try archead while it works with normhead during custom training with16 classes Can anyone explain why model loading fails when I try 'archead' while it works with 'normhead' during custom training with16 classes Dec 18, 2020
@KiLJ4EdeN
Copy link

Hello, it d be nice to provide a better traceback with some of the code, still the problem seems to be the classification layer where the original dataset is supposed to have 85742 unique classes, whereas yours only has 16, you might need to change that manually in the last layer.

@soniamaitieo
Copy link

Hello !
I have the same problem, I want to use my own mini CASIA face dataset (with 91 classes ) for training and I have the same error, I don't know where to change it manually in the code ? I just change the ./configs/arc_res50.yaml file like this:

# general
batch_size: 128
input_size: 112
embd_shape: 512
sub_name: 'arc_res50'
backbone_type: 'ResNet50' # 'ResNet50', 'MobileNetV2'
head_type: ArcHead # 'ArcHead', 'NormHead'
is_ccrop: False # central-cropping or not

# train
train_dataset: './data/CASIA.tfrecord'
binary_img: True
num_classes: 91
num_samples: 14088
epochs: 5
base_lr: 0.0001
w_decay: !!float 5e-4
save_steps: 1000

# test
test_dataset: './data/CASIA_test.tfrecord'

Can I have any help please ?
(and thank you for the implementation of Arcface for TF2 , it's a good job ^_^)

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

3 participants