Kohulan / DECIMER-Image_Transformer

DECIMER: Deep Learning for Chemical Image Recognition using Efficient-Net V2 + Transformer
MIT License
197 stars 51 forks source link

I can't find Transformer_decoder.Transformer in Transformer_decoder.py file. #79

Closed hml1996-fight closed 10 months ago

hml1996-fight commented 10 months ago

just "AttributeError: module 'Transformer_decoder' has no attribute 'Transformer'" Dose it mean Transformer_decoder.Decoder?

OBrink commented 10 months ago

Hello @hml1996-fight,

Could you specify what you have done that caused this error? If possible, provide a code example that I can use to reproduce the error please.

Kind regards, Otto

hml1996-fight commented 10 months ago

I just run DECIMER/DECIMER_EfficinetNetV2_Transfomer_Trainer.py file image I mean Transformer_decoder.py file lacks a function named Transformer.

OBrink commented 10 months ago

Ah, apparently, this file has not been updated after changing to a Transformer-Decoder-Only model as a decoder. Transformer_decoder.Decoder should do the trick :)

hml1996-fight commented 10 months ago

OK. I solved it by set Transformer_decoder.Decoder, but a new problem arose. the error is : image

i find d_model is set by image IMG_EMB_DIM is a tuple

hml1996-fight commented 10 months ago

i sloved it by set d_model = d_model[1] . Thanks a lot!!!

OBrink commented 10 months ago

Great, let me know if you need help with anything else 🙂

hml1996-fight commented 10 months ago

OK. now i can train DECIMER transformer with my own dataset. but i want to pretrain this model with my dataset, could you give me your model.ckpt file rather than model.pd file. Thanks a lot.

OBrink commented 10 months ago

Hey @hml1996-fight,

You can find the checkpoint files on Zenodo: https://zenodo.org/records/8300489

Have a nice day! Otto