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

Error when executing download.py #1

Open
iuri-cv opened this issue Jan 13, 2021 · 8 comments
Open

Error when executing download.py #1

iuri-cv opened this issue Jan 13, 2021 · 8 comments

Comments

@iuri-cv
Copy link

iuri-cv commented Jan 13, 2021

Hi,
I've got the following error message when trying to execute download.py:

([NAME_ENV]) PS C:\Users\sonil> python download.py
>>
C:\Users\sonil\anaconda3\envs\[NAME_ENV]\python.exe: can't open file 'download.py': [Errno 2] No such file or directory

I've performed all previous steps prior to this one. Could someone help me on this ?
Thanks in advance

Iuri C Valadão

@iuri-cv iuri-cv closed this as completed Jan 13, 2021
@iuri-cv iuri-cv reopened this Jan 13, 2021
@iuri-cv
Copy link
Author

iuri-cv commented Jan 14, 2021

So I've figured this out. I hadn't downloaded example testing data. Anyway, now I get the following error when trying to execute main.py :

([NAME_ENV]) C:\Users\INCARTA\Anaconda3\envs\[NAME_ENV]>python main.py
Traceback (most recent call last):
  File "main.py", line 20, in <module>
    from torch.utils.data import Dataset, DataLoader
  File "C:\Users\INCARTA\Anaconda3\envs\[NAME_ENV]\lib\site-packages\torch\__init__.py", line 190, in <module>
    from torch._C import *
ImportError: DLL load failed: The specified module could not be found.

I've searched about this error and already performed the modifications suggested in https://pytorch.org/docs/stable/notes/windows.html#import-error, but I still get the same error.
Any suggestions on this issue ?
Thanks in advance.

Iuri C Valadão

@binli123
Copy link
Collaborator

So I've figured this out. I hadn't downloaded example testing data. Anyway, now I get the following error when trying to execute main.py :

([NAME_ENV]) C:\Users\INCARTA\Anaconda3\envs\[NAME_ENV]>python main.py
Traceback (most recent call last):
  File "main.py", line 20, in <module>
    from torch.utils.data import Dataset, DataLoader
  File "C:\Users\INCARTA\Anaconda3\envs\[NAME_ENV]\lib\site-packages\torch\__init__.py", line 190, in <module>
    from torch._C import *
ImportError: DLL load failed: The specified module could not be found.

I've searched about this error and already performed the modifications suggested in https://pytorch.org/docs/stable/notes/windows.html#import-error, but I still get the same error.
Any suggestions on this issue ?
Thanks in advance.

Iuri C Valadão

This is a PyTorch import error.
Did you install PyTorch appropriately?

@clm92
Copy link

clm92 commented Dec 16, 2022

Hello,
I'm having the same issue as I have not downloaded the example data, but there are no instructions of where to find it. Maybe it is obvious to the creators but one clear sentence on where to find the example data would be very helpful.

@binli123
Copy link
Collaborator

I believe you guys have different issues. The error shown in the previous threads seemed associated with PyTorch not being installed correctly.
The URL is in the download script.

def main():
parser = argparse.ArgumentParser()
parser.add_argument('--url', type=str,
default='https://uwmadison.box.com/shared/static/nu14p71zs3dxr2eqwf4ckzy1edctpesh.zip',
help='url to dataset')
parser.add_argument('--path', type=str, default='data.zip', help='path to store data')
parser.add_argument('--url-weights', type=str,
default='https://uwmadison.box.com/shared/static/u0h4b39127w3dyrl9gjtcx7wwqm7l8e0.pth',
help='url to model weights')
parser.add_argument('--path-weights', type=str, default='weights/shg.pth', help='path to store weights')

If you cannot run the download script, you can download the data and the trained model by copying and pasting these URLs to your web browser.
For example, the testing data is at https://uwmadison.box.com/shared/static/nu14p71zs3dxr2eqwf4ckzy1edctpesh.zip, which is shown in line 32

@clm92
Copy link

clm92 commented Dec 16, 2022

Thank you for such a quick response. I guess what I am getting at, a user can see that they have to run the download script, but there are no instructions on where or how to do that. Where should a user run download.py script?

@binli123
Copy link
Collaborator

Hi, you can run it using python. After the environment and dependencies are installed, just type in python download.py in your terminal (anaconda prompt or command prompt if using Windows). I hope these tutorials on python basics can help https://pythonbasics.org/execute-python-scripts/

@clm92
Copy link

clm92 commented Dec 18, 2022

Hi,
I followed the instructions precisely in the README at https://github.com/uw-loci/he_shg_synth_workflow/tree/v0.1.0#download-example-testing-data-trained-model-weights-fiji and had the same error as the original OP for this thread. Following the README and your instructions in your most recent reply, the next step gives

([shg_synth]) C:\Users\chamoo>python download.py
python: can't open file 'download.py': [Errno 2] No such file or directory

Sure, we can alternatively download the data and trained models by using the urls in the download.py script individually and I can try that next.

However, I have since realised there is an updated version of the instructions at this link https://github.com/uw-loci/he_shg_synth_workflow/blob/master/README.md.

But following these instructions, one does not get past the very first step of copying and pasting:
$ conda env create --name syn --file env.yml
$ conda activate syn

without getting the error
'$' is not recognized as an internal or external command,
operable program or batch file.

Removing the $, we get:
SpecNotFound: Invalid name, try the format: user/package

I understand that these are extremely obvious or simple questions to people who regularly code in python, and I apologise for my questions in advance however for the average histologist who wants to apply these beautiful pipelines to their own experiments, the instructions should be complete enough that they can be followed step by step otherwise they can't be used..

@yuminguw
Copy link
Member

Thanks for your feedback. Very helpful! I just updated the guide . Please check it out at your convenience and let us know if it helps. I noticed this new version has a configuration issue due to package updates and is not working on my Windows system so far. I have filed an issue and hope we can sort it out soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants