0

https://github.com/mravanelli/SincNet

This is the GitHub link provided above to sincnet. I wanted to know how I can run this code in jupyter Notebook or in Pycharm.

This is my first time and I have tried a lot before and I am not able to do it.

Can anyone provide me the full instructions to run this code it is very important.

1 Answers1

0

You could follow this steps:

Step 1: First download all the files. You just download the whole repository that you have linked (click the green button Code -> and then click Download zip). Unzip the files and you'll get a folder, let's call it project_folder. Place this folder wherever you like. Let's say that now the code is at path: /path/to/project_folder.

Step 2: Now they list the following prerequisites for running the code:

Linux
Python 3.6/2.7
pytorch 1.0
pysoundfile ( conda install -c conda-forge pysoundfile)
We also suggest using the anaconda environment.

If you have anaconda they suggest the creation of a conda environment. If you do have it you can do in a terminal: conda create --name myenv python=3.6 and you activate it: coda activate myenv.

If you have a different environment you can should create it with python 3.6 because things might not work otherwise. Then you can install the two other dependencies:

  1. pysoundfile with conda install -c conda-forge pysoundfile. If you don't have conda, a simple pip install PySoundFile should work too.
  2. pytorch: you should check this page for the exact instruction that you should type in your terminal. It depends on your operating system.

Now you can do everything inside a notebook or in a PyCharm project. Let's see first how to do it in a notebook:

Step 3: Open your notebook from the environment you have created, so that all your packages are available, and cd to the directory where your files are stored. In a cell %cd /path/to/project_folder.

Step 4: Execute a script inside the folder, let's call it myScript.py. You simply write the following in a cell: !python myScript.py.


To execute in PyCharm:

Step 3: Create a new project inside the folder where you stored the files.

Step 4: Change the interpreter, clicking on something like <Interpreter> on the bottom right corner of the window. Select your created environment. You could have also skipped step 2 and created the environment directly into PyCharm, it's the same. Just make sure you have all the packages listed.

Step 5: Open the script you want to execute and hit Run.

ClaudiaR
  • 3,108
  • 2
  • 13
  • 27