EasyOCR
EasyOCR copied to clipboard
UserWarning from torchvision
I am running the demo in the readme, but I got several warnings.
import easyocr
reader = easyocr.Reader(['en'])
result = reader.readtext(imgpath + 'sample.png', detail = 0)
print(result)
And I got the following warnings:
warnings.warn(
C:\Users\22612\AppData\Local\Programs\Python\Python39\lib\site-packages\torchvision\models\_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and will be removed in 0.15, please use 'weights' instead.
warnings.warn(
C:\Users\22612\AppData\Local\Programs\Python\Python39\lib\site-packages\torchvision\models\_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and will be removed in 0.15. The current behavior is equivalent to passing `weights=None`.
warnings.warn(msg)```
Torchvision 0.13 added an upgrade that allows to use pre-trained models on different weigths (e.g. different data-sets or their versions). So this
from torchvision import models
model = models.resnet50(pretrained=True)
should now change to something like this
from torchvision import models
model = models.resnet50(weights='ResNet50_Weights.DEFAULT')
You can also disable specific warnings like so
import warnings
warnings.filterwarnings("ignore", category=UserWarning)
So do you believe easyocr will fix that?
@TheMemoryDealer thanks, do you want to create a pull request to fix this warning?
@tdefoin thanks! @rkcosmos should this be closed now?
But why does it appear as I used the DataLoader?I did not use the pretrain.