Pyinstaller & pytorch

I was able to pack a small example app that includes pytorch and pyQt using Pyinstaller but the dist folder is 4GB .

All I am doing is printing pytorch version on QLabel !

 from PyQt5.QtWidgets import QMainWindow, QApplication, QLabel, QVBoxLayout, 
 QPushButton, QWidget
 from PyQt5.QtGui import QIcon
 import sys, os
 from torch import __version__

Am I using Pyinstaller the wrong way ?

Update:

I checked again and 3.99GB is the torch\lib folder that contains all libs and dlls . this is something that i experienced with Libtorch as well. the dependency files are huge.

pytorch is quite big, there might be a way these days to do selective builds cc @malfet

1 Like

Have you been able to fix this issue? Iā€™m running into it as well and could not find another forum mentioning this.