aamini / introtodeeplearning

Lab Materials for MIT 6.S191: Introduction to Deep Learning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lab1 Part2 - !apt-get install abcmidi timidity AND assertion error at len(tf.config.list_physical_devices('GPU')) > 0

AnnaKoziol opened this issue · comments

Hello,
at the beginning, thank you for sharing your knowledge and giving us such a great course :-)

My problem is below (Jupyter Notebook output):

The system cannot find the path specified.

AssertionError Traceback (most recent call last)

in
18 # Check that we are using a GPU, if not switch runtimes
19 # using Runtime > Change Runtime Type > GPU
---> 20 assert len(tf.config.list_physical_devices('GPU')) > 0
21


Any help?

I use Windows 10, Pycharm 2020.3 (within which I run Jupyter Notebook), Python 3.8 conda

Thank you,
Anna

Actually, the error "The system cannot find the path specified." refers to !apt-get install abcmidi timidity > /dev/null 2>&1

I have a related error I'm working through using PyCharm on Widows 10. Let me know if there's a solution!
Error:
'abc2midi' is not recognized as an internal or external command,
operable program or batch file.
'timidity' is not recognized as an internal or external command,
operable program or batch file.

I have a related error I'm working through using PyCharm on Widows 10. Let me know if there's a solution!
Error:
'abc2midi' is not recognized as an internal or external command,
operable program or batch file.
'timidity' is not recognized as an internal or external command,
operable program or batch file.

I moved to colab and it worked there.

commented

I came across the same issues.

Tried to run course notebooks on my Windows 10 PC with one of NVidia RTX cards.

  1. !apt-get install abcmidi timidity
    This is the apt packagae manager command to install packages that are basically required to generate midi files from abc notation and to play midi files. If you are as I am, running this on Windows system it will throw a error because Windows doesn't have the apt package manager in it. As a solutiion I just commented out this string with the '#' symbol and continued further.

  2. len(tf.config.list_physical_devices('GPU')) > 0
    This string ensures that the tensorflow library you have installed on your system is using your GPU instead of CPU. In my case there was a problem with this because I didn't have cudnn64_7.dll in my CUDA Toolkit directory therefor tensorflow was unable to use my graphics card which caused this assert to fail.

There are basically two options here:

  • You can just comment out this assertion with the '#' and continue running the lab on your computer's CPU. I didn't try this option but I suppose it should work but much slower than with the GPU.
  • You can download and install CUDA Toolkit and CUdnn both these libraries are available on NVidia developers website (howerver registration is required to download anything). More thorough instructions can be found here

At the end of the day you can listen to the generated abc-files by simply using one of the available online abc notation players, for example this one https://cdn.rawgit.com/paulrosen/abcjs/main/examples/synth-only.html

On Mac:

  • Comment the line !apt-get install abcmidi timidity in notebook.
  • In your terminal run these 2 commands brew install abcmidi and brew install timidity
  • Now run your notebook, it should work fine

If running locally on Linux, use a terminal and execute

sudo apt-get install abcmidi timidity

Then return to the notebook.