USi-IPEM / Demo-Cell-Classification

Classification
Apache License 2.0
1 stars 1 forks source link

Problem to run python files in WSL Ubuntu 18.4 #4

Closed arpm92 closed 4 years ago

arpm92 commented 4 years ago

I tried to run the code in my pc, however, there was some problem. It is supposed to find the folders, but no idea why it did not work.

Console:

`alejandro@DESKTOP-37TSKKP:/mnt/d/05_Projekte/04_Research/08_ManuBrain/01_Lab/Demo-Cell-Classification/classifier$ python 3 data_loader.py Traceback (most recent call last): File "data_loader.py", line 194, in os.chdir(os.path.dirname(file)) FileNotFoundError: [Errno 2] No such file or directory: ''

alejandro@DESKTOP-37TSKKP:/mnt/d/05_Projekte/04_Research/08_ManuBrain/01_Lab/Demo-Cell-Classification/classifier$ python 3 train_test_svm_classifier.py Traceback (most recent call last): File "train_test_svm_classifier.py", line 13, in os.chdir(os.path.dirname(file)) FileNotFoundError: [Errno 2] No such file or directory: ''`

v0lta commented 4 years ago

This system call probably does not work properly. All it does is print the current path. Try commenting lines 13 and 14.

v0lta commented 4 years ago

In data_loader.py 194 and 195 are also not required. Just remove these.

v0lta commented 4 years ago

On second thought, this will probably just lead to a crash in os walk. Probably the fix will involve changing the folder list in lines 7 to 11 of train_test_classifier.py . Perhaps use ./ instead of ../? From where are you executing the python interpreter?

arpm92 commented 4 years ago

I execute it directly from the Ubuntu console from windows


Mit freundliche Grüßen, Alejandro Perez, Dipl.-Ing.

Sent from my mobile device.


Von: Moritz Wolter notifications@github.com Gesendet: Freitag, 9. Oktober 2020, 11:10 An: manubrain/Demo-Cell-Classification Cc: Alejandro Pérez; Author Betreff: Re: [manubrain/Demo-Cell-Classification] Problem to run python files in WSL Ubuntu 18.4 (#4)

On second thought, this will probably just lead to a crash in os walk. Probably the fix will involve changing the folder list in lines 7 to 11 of train_test_classifier.py . Perhaps use ./ instead of ../? From where are you executing the python interpreter?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/manubrain/Demo-Cell-Classification/issues/4#issuecomment-706066399, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABNH7WSKPYXELTLCWHAFZVTSJ3HQ3ANCNFSM4SJZOT2Q.

v0lta commented 4 years ago

I am asking for the current path of the console. It's determined by running pwd. The dot notation ./ indicates relative paths. './' means current directory, '../' means up one directory. I am suspecting that the code does not run, because your absolute path (pwd) where you are running from is different from what I did.

v0lta commented 4 years ago

I ran the code from within the Demo-Cell-Classification/classifier/ folder. Threfore it goes up one directory '../' .

arpm92 commented 4 years ago

Solved the issue. The problem was the:

`#os.chdir(os.path.dirname(file))

print(os.getcwd())`