files i downloaded after training the model :
- config.json
- model.safetensors
- logs > hparams/yaml ( empty file )
- logs > events.out.tfevents.1707970167.d4c7dd713d7a.235.0
- logs > checkpoint > output.ckpt
The following code was used to save :
MODEL_PATH = 'custom-model'
model.model.save_pretrained(MODEL_PATH)
The custom-model folder contains the file number 1&2 (config.json and model.safetensors)
when i try to load the model which was custom-trained by me in the same session of google colab it works fine , but when the same folder is copied to another colab notebook and tried to execute , it throws this error :
/data does not appear to have a file named preprocessor_config.json
this code is used to load the custom model
CHECKPOINT = 'models/data'
image_processor = DetrImageProcessor.from_pretrained(CHECKPOINT)
model = DetrForObjectDetection.from_pretrained(CHECKPOINT)
okay so the problem was in this line
replaced the CHECKPOINT with
'facebook/detr-resnet-50'complete code for loading the model
and the models/data contains all the files ( 1-5 ) mentioned in the above question