models
models copied to clipboard
correct_k = correct[:k].view(-1).float().sum(0, keepdim=True) RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.
When pytorch is 1.7 in oneAPI AI toolkit, there is error in running case:
cd models/models/image_recognition/pytorch/common/
python main.py -d /home/wj/ImageNet/data/all -a resnet50 --epochs 100 --learning-rate 0.1 --print-freq 1 -b 64 –ipex
...
correct_k = correct[:k].view(-1).float().sum(0, keepdim=True)
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.
view() is not supported and use reshape() to fix it.
@arthw can you try our latest optimzations https://www.intel.com/content/www/us/en/developer/articles/containers/cpu-reference-model-containers.html for pytorch rn50 model to see if this resolves your issue?