files i downloaded after training the model :
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
image_processor = DetrImageProcessor.from_pretrained(CHECKPOINT)
replaced the CHECKPOINT with 'facebook/detr-resnet-50'
complete code for loading the model
CHECKPOINT = 'models/data'
image_processor = DetrImageProcessor.from_pretrained('facebook/detr-resnet-50')
model = DetrForObjectDetection.from_pretrained(CHECKPOINT)
and the models/data contains all the files ( 1-5 ) mentioned in the above question