I have tried to convert the image to PIL and then transform it to tensor:
def predict(img_path):
    PATH = './wytrenowaned.pth'
    img = Image.open(img_path)
    pil_to_tensor = transforms.ToTensor()(img).unsqueeze_(0)
    print(pil_to_tensor)
    classes = ('glass', 'metal', 'paper', 'plastic')
    # testset = torchvision.datasets.ImageFolder(
    #     root='./resources/smieci', transform=transform)
    # testloader = torch.utils.data.DataLoader(
    #     testset, batch_size=4, shuffle=True, num_workers=2)
    # dataiter = iter(testloader)
    # images, labels = dataiter.next()


# print images
# imshow(torchvision.utils.make_grid(images))
    # print('GroundTruth: ', ' '.join('%5s' %
    #                                 classes[labels[j]] for j in range(4)))
    # print('---')
    # print(images)
    # print('---')
    net.load_state_dict(torch.load(PATH))
    outputs = net(pil_to_tensor)
    _, predicted = torch.max(outputs, 0)

but it gives me an error
RuntimeError: Given groups=1, weight of size [6, 3, 5, 5], expected input[1, 1, 299, 299] to have 3 channels, but got 1 channels instead

any ideas?