The error message is indicating that the target size and the input size of your model have different dimensions. More specifically, the target size has a spatial resolution of (350, 350), while the input size has a spatial resolution of (88, 88). This can cause issues during model training, as the output of the model may not match the expected dimensions of the target.
To fix this issue, you can try one or more of the following solutions:
- Resize the input images to match the target size: You can resize the input images to have the same spatial resolution as the target size. This can be done using image resizing libraries such as OpenCV or PIL. Make sure to apply the same resizing to both the input images and the corresponding target masks.
- Change the model architecture: You can modify the architecture of the HRNet OCR model to match the input size of your images. Specifically, you can adjust the spatial resolution of the final output of the model to match the input size. This can be done by modifying the number of output channels in the last convolutional layer of the model, as well as the size of the output feature maps.
- Use a different model: If you are unable to modify the input size or the model architecture to match the target size, you may need to consider using a different model that is better suited for your specific use case. For example, you could try using a different semantic segmentation model that is designed for smaller input sizes.
I hope this helps! Let me know if you have any further questions or if you need more guidance on implementing these solutions.