I have generated an Tkinter GUI and generated one exe file that copied model weights.
the weights folder is in the same folder of the myTKcode.py file.
I generate my model as and load weights as below:
import tensorflow as tf
model = MyModel()
model.load_weights("weights/MyModelWeights")
Now if I use pyinstaller to generate an exe file as below:
pyinstaller --onefile --add-data weights;weights myTKcode.py
Based on the size of the myTKcode.exe
file I can say that weights have been added in the myTKcode.exe
. But when I run the myTKcode.exe
file, it does not find the weights folder. But if I copy paste the weights folder in the dist
folder where myTKcode.exe
is, it works.
my question is how access the weights stored in the myTKcode.exe
?