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
Hook for pytorch #2666
Comments
I using a very silly way: add the torch package to the |
It takes me a while to figure out the solution from @AceCoooool
I assume your torch is placed right there
It copies all content from torch to your desired location. Basically, I think it's a bug that should be fixed @htgoebel |
@iamtodor This way work, but it is not what I'd call a solution. A solution would be to provide a hook, so others will not step into these issue. |
@htgoebel yes, this way is very dirty. So that's why I ask to call it the bug and fix it |
@iamtodor You are very welcome to provide a pull-request: https://pyinstaller.readthedocs.io/en/stable/hooks.html |
Have you solve the problem? pyinstaller test.py is completed successfully. However, when run this exe file, there is the error like that |
Hi, |
You may try reinstall pytorch. That works for me. |
I've run into similar problem, but none of the workarounds work. What is strange, my .exe file works when run from anaconda environment (any env: with or without torch installed), but when I try to run it from cmd outside of anaconda it gives me error:
line 1 in verify.py is Win 10 |
I'm having a similar issue: Update |
@raviv Wow, it works! Thank you - it's third day I'm trying to get it work. I'm wondering what is the source of this problem, is it pytorch for windows, or pyinstaller? Additional note: when I'm using plain Python (without conda), with pytorch installed from pip, it also crushes, exactly like above. So it seems that the workaround is to use conda, but install pytorch with pip (???). I don't know, it is some dark wizardry here... |
@MarcinMisiurewicz glad it worked for you. |
when I've checked the dependency walker it think it was both: cudatoolkit and Python37.dll. I'll check it |
@MarcinMisiurewicz After removing pytorch from conda and installing it using pip (in coda env) I can now build an exe that runs on a clean windows machine, with CUDA toolkit and driver installed of course. |
i made a simple application to calculate speed between cpu and gpu and its works fine in my anaconda environment but whenever i am trying to make .exe of that particular file which raise an error that cudatoolkit is not found do conda install cudatoolkit my code as below temp.py file from numba import jit,cuda to measure exec timefrom timeit import default_timer as timer normal function to run on cpudef func(a): function optimized to run on gpu@jit(target ="cuda")
and error which i got as below while i am running exe file:- cudatoolkit is not found whereas i installed cudatoolkit=9.0 in my conda environment. and if i try to make .exe using either conda or cmd its give me an same error |
this is also a solution for me. |
This was fixed in #3657. |
definitely still a thing in 4.4 |
Open a new issue if you want us to be able do anything about it. I imagine that pytorch has changed a bit since 3 and a half years ago. |
pyinstaller test.py
is completed successfully. However, when run this exe file, there is the error like that:This is maily caused by
path
,torch_shm_manager is in the file /home/ace/.pyenv/versions/anaconda3-4.2.0/lib/python3.5/site-packages/torch/lib/torch_shm_manager. (this is because pyinstaller change the file to the current file: /home/ace/Developer/temp/dist/test)How can I just let my torch package not change the file ? (Even I can not use this exe file in other computers)
Could anyone help me? thank you.
The text was updated successfully, but these errors were encountered: