If you are using a pretrained model, I would recommend to use the same preprocessing as was used to train this model.
In your case, you should use the second normalization approach.
Also, you might change the preprocessing but would probably need to fine tune the complete model.
As always, it depends on the use case and you would have to try out different approaches.



 Korsarz:

I expected value between (0,1), because in many examples, people use if(score >0.5) to determine if the prediction is good.


It seems you are working on a multi-class classification (with probably nn.CrossEntropyLoss as the criterion). If that’s the case, then your model will output class logits, which are not limited to the range [0, 1]. To get the predicted class, the argmax usage is correct.
If you want to see the probabilities for e.g. debugging, you could apply softmax on your model output.
Note that you should not pass the softmax(output) to nn.CrossEntropyLoss, as internally F.log_softmax will be applied!



 Korsarz:

After he don’t use his database, only database from resnet, so if I use pretrain network I don’t have to have own database? I don’t see the place in program where he connects his database and database from resnet. I don’t understand this.


I see a custom Dataset definition in the tutorial and it’s being used in the training loop via:
for i, (inputs, labels) in enumerate(dataloaders[phase]):
    ...