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

Failed in running gradient_descent.py. #6

Open
geyang78 opened this issue Jun 24, 2020 · 1 comment
Open

Failed in running gradient_descent.py. #6

geyang78 opened this issue Jun 24, 2020 · 1 comment

Comments

@geyang78
Copy link

Hello, I have installed all the Software Libraries required, and removed the header (the first line of Advertising.csv), removed the ids (the first column of Advertising.csv), and then replaced the comas by tabs (real tabs, not 2/4/8 spaces). However, I still failed in running it.
PS C:\Users\DELL> & C:/Users/DELL/AppData/Local/Programs/Python/Python36/python.exe "e:/Work/2020-Summer/other/Research Project/Report/ML/from future import print_function.py"
epoch: 0 loss: 92.32078294903626
w, b: 0.7412639000000002 0.028045000000000007
Traceback (most recent call last):
File "e:/Work/2020-Summer/other/Research Project/Report/ML/from future import print_function.py", line 74, in
w, b = train(x, y, 0.0, 0.0, 0.001, 15000)
File "e:/Work/2020-Summer/other/Research Project/Report/ML/from future import print_function.py", line 60, in train
fig1.savefig('../../Illustrations/gradient_descent-' + str(image_counter) + '.eps', format='eps', dpi=1000, bbox_inches = 'tight', pad_inches = 0)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\matplotlib\figure.py", line 2203, in savefig
self.canvas.print_figure(fname, **kwargs)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\matplotlib\backend_bases.py", line 2126, in print_figure
**kwargs)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\matplotlib\backends\backend_ps.py", line 831, in print_eps
return self._print_ps(outfile, 'eps', *args, **kwargs)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\matplotlib\backends\backend_ps.py", line 851, in _print_ps
orientation, papertype, **kwargs)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\matplotlib\cbook\deprecation.py", line 358, in wrapper
return func(*args, **kwargs)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\matplotlib\backends\backend_ps.py", line 1076, in _print_figure
with open(outfile, 'w', encoding='latin-1') as fh:
FileNotFoundError: [Errno 2] No such file or directory: '../../Illustrations/gradient_descent-2.eps'
PS C:\Users\DELL>
How to solve this problem.
Thank you very much.

@BilboBaagins
Copy link

You possibly just need to create the Illustrations folder two levels above the current working directory, indicated by ../../Illustrations/ so the plots can be saved.

FileNotFoundError: [Errno 2] No such file or directory: '../../Illustrations/gradient_descent-2.eps'

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