quinngroup / dr1dl-pyspark

Dictionary Learning in PySpark
Apache License 2.0
1 stars 1 forks source link

Running and debugging the Python Code #22

Closed MOJTABAFA closed 8 years ago

MOJTABAFA commented 8 years ago

@LindberghLi For running and debugging the python code , I need following information to make sure about the functionality of the program, after that we can work on benchmarking of this program and the C++ version one :

  1. Input file (already you gave me)
  2. The desired output file for that specific input ( for checking if the program works properly.
  3. Other items values like epsilon, T, D, M, P, percentage of non zero elements and etc.,

Please provide me this info as soon as you can .

MOJTABAFA commented 8 years ago

@magsol Solved !------- Dear Dr. Quinn : Here is the first error I faced in running the program , would you please checki it and advise me ? [Anaconda3] C:\Users\Mojtaba Fazli\Desktop>python dictlearningpython.py -i test -d file_d.txt -o file_z.txt -s file_summary.txt -l 1025 -P 75 -n 254 -m 33 -e .0 2 File "dictlearningpython.py", line 129 file_s = str(args['input']) ^ IndentationError: unindent does not match any outer indentation level

MOJTABAFA commented 8 years ago

@magsol Solved !----- even I resolved it , again in other lines it gives the same error, However, the indentation is correct and sometimes I had to re-write the instructions !

MOJTABAFA commented 8 years ago

Solved ! ---- sysntax errors are debugged now. My input file is in desktop, where the original .py file is located. but after running the following error is been appeared :

[Anaconda3] C:\Users\Mojtaba Fazli\Desktop>python DictLearningPythonclean.py -i test.txt -d file_D.txt -o file_Z.txt -s file_Summary -l 1046 -P 528 -n .4 -m 256 -e 0.01 The Input file is loading... Traceback (most recent call last): File "DictLearningPythonclean.py", line 129, in main() File "DictLearningPythonclean.py", line 70, in main S = np.loadtxt(file_s) File "C:\Anaconda3\lib\site-packages\numpy\lib\npyio.py", line 693, in loadtxt

fh = iter(open(fname))

FileNotFoundError: [Errno 2] No such file or directory: 'test.txt'

MOJTABAFA commented 8 years ago

@magsol I already modified the path and this problem is solved too. but again there is another problem which belongs to set the parameters. As I emphasized in first comment ,Since I'm not expert in this program, I need the input parameters from xiang. Unless I dont have the parameter I cannot check with more scrutiny:

[Anaconda3] C:\Users\Mojtaba Fazli\Desktop>python DictLearningPythonclean.py -i test.txt -d file_D.txt -o file_Z.txt -s file_Summary -l 1046 -P 528 -n .4 -m 256 -e 0.01 The Input file is loading... Training ....

Initalization is complete! Analyzing component 1 ... Traceback (most recent call last): File "DictLearningPythonclean.py", line 129, in main() File "DictLearningPythonclean.py", line 98, in main v = np.dot(S,u_old) ValueError: shapes (170,39510) and (1046,) not aligned: 39510 (dim 1) != 1046 (d im 0)

Thanks

magsol commented 8 years ago

@MOJTABAFA:

Several things.

@LindberghLi:

Can you post some sample input data and the expected output?

MOJTABAFA commented 8 years ago

@magsol

magsol commented 8 years ago

@MOJTABAFA, in Sublime Text, make sure you have these settings in your user profile configuration:

"translate_tabs_to_spaces": true,
"wrap_width": 80,
"tab_size": 4

Those should fix the inconsistencies between Sublime Text and the console.

XiangLi-Shaun commented 8 years ago

I have created two folders in the project, named "testSe1" and "testSet2", which contains the input file ("S.txt"), the parameter setting ("parameter.txt") and the output files ("D_groundtruth.txt" and "z_groundtruth.txt'). These simulated data are of very small scale, and solely for the purpose of testing whether the current code are running.

MOJTABAFA commented 8 years ago

Thanks Xiang, I already left the lab, tomorrow will back and complete it. Thanks Dr. Quinn for all lessons you are teaching me.