facenet-pytorch icon indicating copy to clipboard operation
facenet-pytorch copied to clipboard

User Warning when using PyInstaller: torchvision\__init__.py:26: UserWarning: You are importing torchvision within its own root folder

Open Tomas1337 opened this issue 4 years ago • 4 comments

When packaging my module using PyInstaller where I have import facenet_pytorch

This user warning comes out and I think it is leading torch problems down the line:

torchvision_init_.py:26: UserWarning: You are importing torchvision within its own root folder (C:\Projects\NDI_FaceTrack_v1\NDI_FaceTrack\dist\cli). This is not expected to work and may give errors. Please exit the torchvision project source and relaunch your python interpreter.

I've dialed the error down to this line as the Warning disappears if I comment the import line.

python = 3.8.6 torchaudio = 1.7.0 torchvision = 0.8.1 facenet-pytorch = 2.5.1 pyinstaller = 4.1

Tomas1337 avatar Dec 01 '20 15:12 Tomas1337

Hi, can you share your build.spec ?

amzar96 avatar Sep 27 '21 13:09 amzar96

I think this happend because you install torchvision, and you are import torchvision in the install directory. so, you could cd ../ (just change a directory) and then python import torchvision It's OK

huajng avatar Jan 13 '22 04:01 huajng

I think this happend because you install torchvision, and you are import torchvision in the install directory. so, you could cd ../ (just change a directory) and then python import torchvision It's OK

Oh~ Yes! Thx a lot, it confused me for a long time!

zafirshi avatar May 18 '22 11:05 zafirshi

I think this happend because you install torchvision, and you are import torchvision in the install directory. so, you could cd ../ (just change a directory) and then python import torchvision It's OK

Great!

gzzyyxh avatar Sep 24 '22 18:09 gzzyyxh