title: FastAI PyTorch Train_loss and valid_loss look very good, but the model recognize nothing
body: <p><strong>Update 1</strong></p>
  
  <p>I’m thinking that it might be the mistake in my detector code.
  So, here is my code for using the trained learner/model to predict images.</p>
  
  <pre><code>import requests
  import cv2
  
  bytes = b''
  stream = requests.get(url, stream=True)
  bytes = bytes + stream.raw.read(1024) # I have my mobile video streaming to this url. the resolution for the video streaming is: 2048 x 1080
  a = bytes.find(b'\xff\xd8')
  b = bytes.find(b'\xff\xd9')
  if a != -1 and b != -1:
        jpg = bytes[a:b+2]
        bytes = bytes[b+2:]
        img = cv2.imdecode(np.fromstring(jpg, dtype=np.uint8), cv2.IMREAD_COLOR)
        processedImg = Image(pil2tensor(img, np.float32).div_(255))
        predict = learn.predict(processedImg)
        self.objectClass = predict[0].obj
  </code></pre>
  
  <p>and I read the document of imdecode() method, it returns image in B G R order.</p>
  
  <p><strong>Could it because of different channel data used when in training and detecting?</strong></p>
  
  <p>Or </p>
  
  <p><strong>Could it because that I trained with image size 299 x 450, but when detecting the input image size from the video streaming is 2048 x 1080 without resizing it?</strong></p>
  
  <hr>
  
  <p>new to FastAi, ML and Python. I trained my “Birds Or Not-Birds” model. The train_loss, valid_loss and error_rate were improving. If I only trained 3 epochs, then the model worked(meaning it can recognize whether there are birds or no birds in images), then I increased to 30 epochs, all metrics look very good, but the model does not recognize things anymore, whatever images I input, the model always return Not-Birds.</p>
  
  <p>here is the training output:</p>
  
  <p><a href="https://i.stack.imgur.com/CFdld.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CFdld.png" alt="enter image description here"></a></p>
  
  <p>Here are the plots of learn.recorder</p>
  
  <p><a href="https://i.stack.imgur.com/J0taK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/J0taK.png" alt="enter image description here"></a></p>
  
  <p>Here is my code:</p>
  
  <pre><code>from fastai.vision import *
  from fastai.metrics import error_rate
  from fastai.callbacks import EarlyStoppingCallback,SaveModelCallback
  from datetime import datetime as dt
  from functools import partial
  
  path_img = '/minidata'
  train_folder = 'train'
  valid_folder = 'validation'
  
  tunedTransform = partial(get_transforms, max_zoom=1.5)
  
  data = ImageDataBunch.from_folder(path=path_img, train=train_folder, valid=valid_folder, ds_tfms=tunedTransform(), 
                                    size=(299, 450), bs=40, classes=['birds', 'others'], 
                                    resize_method=ResizeMethod.SQUISH)
  data = data.normalize(imagenet_stats)
  
  learn = cnn_learner(data, models.resnet50, metrics=error_rate)
  learn.fit_one_cycle(30, max_lr=slice(5e-5,5e-4))
  
  learn.recorder.plot_lr()
  learn.recorder.plot()
  learn.recorder.plot_losses()
  </code></pre>
  
  <p>Here is my dataset folder structure:</p>
  
  <ul>
  <li>minidata
  
  <ul>
  <li>train
  
  <ul>
  <li>birds (7500 images)</li>
  <li>others (around 7300 images)</li>
  </ul></li>
  <li>validation
  
  <ul>
  <li>birds (1008 images)</li>
  <li>others (around 872 images)</li>
  </ul></li>
  </ul></li>
  </ul>