%99 Accuracy on Valid Data, %1 Accuracy on Test Data, What Am I Missing?

This is actually pretty reasonable, but since I use valid_pct in databuilder, I don’t know where my valid folder is. But I’ve got top losses:

UPDATE:
I’ve found a way to get predictions from valid_pct and there seems to be no problems:

for resim in data.valid_ds.items[:10]:

model = learn.model

model = model.cuda()

img = open_image(resim)

prediction = learn.predict(img)

ad = os.path.basename(resim)

ad2 = os.path.join(‘/content/content/abece/’, ad[8], ad)

display(Image(filename=ad2))

print(prediction[0])

print(resim)

output:

ANOTHER UPDATE:

It may be indeed a normalization problem:

from matplotlib import image

from matplotlib import pyplot

trained_image = image.imread(‘/content/content/abece/D/cikar_D_D-8231.jpg’)
test_image = image.imread(‘/content/content/test/test1.jpg’)

data = asarray(test_image)
data1 = asarray(trained_image)

print(data)
print(“\n”)
print(data1)

output:

[[249 253 253 244 … 241 238 238 239]
[229 242 252 251 … 243 241 239 239]
[238 247 255 255 … 251 254 253 251]
[235 204 167 148 … 189 208 227 247]

[212 162 95 53 … 120 170 205 233]
[245 233 218 210 … 226 238 245 249]
[236 238 242 250 … 250 249 247 246]
[233 232 231 234 … 241 238 238 237]]

[[255 255 255 255 … 255 255 255 255]
[255 255 255 255 … 255 255 255 255]
[255 255 255 255 … 255 255 255 255]
[255 255 255 255 … 255 255 255 255]

[255 255 255 255 … 255 255 255 255]
[255 255 255 255 … 255 255 255 255]
[255 255 255 255 … 255 255 255 255]
[255 255 255 255 … 255 255 255 255]]