Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when building a Pytorch based program using Pyinstaller #5402

Closed
piyumalranawaka opened this issue Dec 21, 2020 · 3 comments
Closed

Issue when building a Pytorch based program using Pyinstaller #5402

piyumalranawaka opened this issue Dec 21, 2020 · 3 comments
Labels
solution:duplicate Resolved: This issue is a duplicate.

Comments

@piyumalranawaka
Copy link

I get the following error when I am trying to build pytorch based program. Any advise on fixing this issue would be greatly appreciated:

Traceback (most recent call last):
File "/home/piyumal/anaconda3/envs/pytorchenv/bin/pyinstaller", line 8, in
sys.exit(run())
File "/home/piyumal/anaconda3/envs/pytorchenv/lib/python3.8/site-packages/PyInstaller/main.py", line 114, in run
run_build(pyi_config, spec_file, **vars(args))
File "/home/piyumal/anaconda3/envs/pytorchenv/lib/python3.8/site-packages/PyInstaller/main.py", line 65, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "/home/piyumal/anaconda3/envs/pytorchenv/lib/python3.8/site-packages/PyInstaller/building/build_main.py", line 720, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "/home/piyumal/anaconda3/envs/pytorchenv/lib/python3.8/site-packages/PyInstaller/building/build_main.py", line 667, in build
exec(code, spec_namespace)
File "/media/piyumal/UUI/Research/Image Classification/PyTorch/resnet/script.spec", line 20, in
exe = EXE(pyz,
File "/home/piyumal/anaconda3/envs/pytorchenv/lib/python3.8/site-packages/PyInstaller/building/api.py", line 436, in init
self.pkg = PKG(self.toc, cdict=kwargs.get('cdict', None),
File "/home/piyumal/anaconda3/envs/pytorchenv/lib/python3.8/site-packages/PyInstaller/building/api.py", line 200, in init
self.postinit()
File "/home/piyumal/anaconda3/envs/pytorchenv/lib/python3.8/site-packages/PyInstaller/building/datastruct.py", line 160, in postinit
self.assemble()
File "/home/piyumal/anaconda3/envs/pytorchenv/lib/python3.8/site-packages/PyInstaller/building/api.py", line 286, in assemble
archive = CArchiveWriter(self.name, srctoc + mytoc,
File "/home/piyumal/anaconda3/envs/pytorchenv/lib/python3.8/site-packages/PyInstaller/archive/writers.py", line 332, in init
super(CArchiveWriter, self).init(archive_path, logical_toc)
File "/home/piyumal/anaconda3/envs/pytorchenv/lib/python3.8/site-packages/PyInstaller/archive/writers.py", line 64, in init
self._finalize()
File "/home/piyumal/anaconda3/envs/pytorchenv/lib/python3.8/site-packages/PyInstaller/archive/writers.py", line 96, in _finalize
self.save_trailer(toc_pos)
File "/home/piyumal/anaconda3/envs/pytorchenv/lib/python3.8/site-packages/PyInstaller/archive/writers.py", line 439, in save_trailer
tocstr = self.toc.tobinary()
File "/home/piyumal/anaconda3/envs/pytorchenv/lib/python3.8/site-packages/PyInstaller/archive/writers.py", line 262, in tobinary
rslt.append(struct.pack(self.ENTRYSTRUCT + '%is' % nmlen,
struct.error: 'i' format requires -2147483648 <= number <= 2147483647

@bwoodsend
Copy link
Member

@rokm Is that not the error you used to get if you try to squeeze too big a package (>2GB) into a one-file?

@rokm
Copy link
Member

rokm commented Dec 21, 2020

@rokm Is that not the error you used to get if you try to squeeze too big a package (>2GB) into a one-file?

It is.

@piyumalranawaka You're hitting the maximum size limit of 2 GB for onefile mode. Take a look at #3939 for possible solutions.

@bwoodsend bwoodsend added the solution:duplicate Resolved: This issue is a duplicate. label Dec 21, 2020
@piyumalranawaka
Copy link
Author

Thank you very much indeed for your kind advise, I will check into possible solutions :)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
solution:duplicate Resolved: This issue is a duplicate.
Projects
None yet
Development

No branches or pull requests

3 participants