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

Code does not run as it is #17

Closed
icsimlai opened this issue Jul 10, 2018 · 5 comments
Closed

Code does not run as it is #17

icsimlai opened this issue Jul 10, 2018 · 5 comments

Comments

@icsimlai
Copy link

Is there a version dependency of "process.ipynb". When try to run the code as it is I get lots of errors in
Jupiter with Python 3, eg, following code does not run:
"c.items().sort(key=lambda x: x[0])"
has to be changed to ,
"sorted(c.items(), key=lambda x: x[0])"
No Print statements runs

@ayush1997
Copy link
Owner

It uses Python2.7

@icsimlai
Copy link
Author

Do the python files in "DeepLearning" folder has same dependency on Python2.7? Do you have a plan to update to Python 3? With almost zero comments in the code it's difficult for someone else to do the same.

@icsimlai
Copy link
Author

When trying to run I get errors as shown below:
python scraper.py "."
extract
Traceback (most recent call last):
File "scraper.py", line 72, in
main()
File "scraper.py", line 68, in main
extract(link)
File "scraper.py", line 47, in extract
urllib.urlretrieve(domain+img, path+str(img_no)+".png")
AttributeError: module 'urllib' has no attribute 'urlretrieve'

@ayush1997
Copy link
Owner

ayush1997 commented Jul 10, 2018

That has to do with the python version.
I do not have any plans to update it to 3 as of now.

@icsimlai
Copy link
Author

icsimlai commented Jul 11, 2018

Hi,
Is the following code correct, specially "elif" blocks?

train_images_dict = {}
test_images_dict={}
count = 1
for i in index_list:

if i== "normal":
    train_images_dict["normal"]=index_list[i][100:200]
    test_images_dict["normal"] = index_list[i][201:250]

elif i=="nodule" :
    train_images_dict[i]=index_list[i][:54]
    test_images_dict[i] = index_list[i][49:]

elif i=="calcinosisnodule":
    train_images_dict['calcinosisnodule'] = index_list[i][:23]
    test_images_dict["calcinosisnodule"] = index_list[i][23:]

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

2 participants