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

What should I expect to happen with Notebooks, PyTorch, Tensorflow or Labs? #235

Open
lufonzi opened this issue Aug 5, 2023 · 3 comments

Comments

@lufonzi
Copy link

lufonzi commented Aug 5, 2023

I am NOT a developer and I am trying to follow the AI for Beginners course. I have done everything possible to follow the instructions to execute the code included in the course, but no matter how hard I try, I cannot go beyond visualizing the code. I am lost and do not know what to expect when I see that a topic comes with a Notebook or a PyTorch or a Tensorflow or a Lab. I have gone through the contents explained in the "How to Run the Code" page, I have gone through the post from Dmitri Soshnikov but nothing has enlightened me... Any suggestion for me to be able to progress?
Thank you

Originally posted by @lufonzi in #103 (comment)

@lufonzi lufonzi changed the title I am NOT a developer and I am trying to follow the AI for Beginners course. I have done everything possible to follow the instructions to execute the code included in the course, but no matter how hard I try, I cannot go beyond visualizing the code. I am lost and do not know what to expect when I see that a topic comes with a Notebook or a PyTorch or a Tensorflow or a Lab. I have gone through the contents explained in the "How to Run the Code" page, I have gone through the post from Dmitri Soshnikov but nothing has enlightened me... Any suggestion for me to be able to progress? What should I expect to happen with Notebooks, PyTorch, Tensorflow or Labs? Aug 5, 2023
@omar908
Copy link
Contributor

omar908 commented Aug 9, 2023

Hi @lufonzi, I myself have just started with this course so I have not gone through much of yet just yet.

From the description above, if seems you are having issues with setting up to run the code locally, is that correct?
Or are you trying to just get some clarification on what exactly you are supposed to see when doing some of these activities?

If you could provide an exact file you are currently going through in which this applies that would help me see, if I can help out somehow.

@lufonzi
Copy link
Author

lufonzi commented Aug 19, 2023

Hi @omar908, I am not a developer. Everything in GitHub is not familiar to me. The course on AI provides a table with examples, but I need to install and configure "stuff" before I can actually access them (https://github.com/microsoft/AI-For-Beginners#content). The course assumes that I know what a notebook is, or what Pytorch or TensorFlow are ... but I don't... I have tried to follow the instructions at this page: https://github.com/microsoft/AI-For-Beginners/blob/main/etc/how-to-run.md. But instructions are not for people that ignores everything about Python or development in general.

I have now understood a number of things:

  1. to find and modify a text file I do not need to do it frome the miniconda console; I could find the requirements.txt file and modify it from the Windows 11 user interface, leveraging Notepad. I would have not otherwise known how to find and edit the file in the miniconda console in order to follow GanGral suggestion.
  2. running the command "conda env create --name ai4beg --file .devcontainer/environment.yml" after having modified the requirements.txt file produced an error and I could figure out that to solve it I should have delete or rename a directory named ai4beg that is located here C:\Users<my-user>\AppData\Local\miniconda3\envs

Currenty, when I am writing, the environment creation is still running, but at the end of it I have no idea about how to execute Python code in Jupyter Notebooks or how to go through the other examples...

Hopefully the description of my difficulties gives you a clear picture of my needs. What would you suggest that I read to be more confortable going through this training?

Thank you

@omar908
Copy link
Contributor

omar908 commented Aug 22, 2023

Hi @lufonzi ,

Seems you are steering in the right direction, from the two points you have listed.
After modifying the requirements, things should install well hopefully, worst case scenario you may need to delete the environment (as you pointed with deleting a directory, however I suggest deleting it using the Conda command to be sure it is removed correctly) and re-create it by running the commands from the how to run.


I think it would be good for you to familiriaze with what some of the components you are working with actually are, and their purpose.

First one would be Conda.

As per their webstite: "Conda is a powerful package manager and environment manager that you use with command line commands at the Anaconda Prompt for Windows, or in a terminal window for macOS or Linux."

The main takeaway can be: package manager and environment manager, which allows you to create different environments for different projects.

Think of it like this, you have a Default environment when using Conda, this has the minimum required software to run. When you create a new environment, normally it is a copy of the Default environment under a new environment name.

Now when you activate this new environment and add new packages (Add new software), you are modifying the new environment and not the Default environment. This is good, in the case of wanting to experiment different version of software you can always make a new enviroment from the Default, or you can even copy the current environment you have and modify the software from there without having the concern of breaking your current one.

Here is a link if interested Getting Started with Conda, or the Conda Cheat Sheet

Also note there are a few similar terms that you may hear when dealing with Conda, such as Miniconda and Anaconda.

Both Miniconda and Anaconda use Conda for the management of their packages (Software) and their environments.

The differences is, Miniconda installs the bare minimum to use Conda within the Default environment. While, from my understanding at least, Anaconda installs a lot more packages which are aimed for Data Scientist's type of work.


As for Jupyter Notebooks the definition they provide is the following: "The Jupyter Notebook is the original web application for creating and sharing computational documents. It offers a simple, streamlined, document-centric experience."

One of the usefulness of Jupyter Notebooks, is portability and reproducibility. It usually allows documentation/information to be alongside of snippets of code that can validate, confirm, or show what the text is referring to.

This is what you will see when doing this course (I went through the first few, and saw having this structure).

Do you need Jupyter Notebook for this course, no.
I recommend the suggestion they having within the hot to run to utilize the visual studio code with python extension, I tried both out and the experience was the same for me, but visual studio code is a lot more user friendly do to it being all one GUI application.

https://github.com/microsoft/AI-For-Beginners/blob/main/etc/how-to-run.md#using-visual-studio-code-with-python-extension

I would like to emphazie a bit on the note underneath this approach:
Note: If VS Code suggests you to re-open the repository in container, you need to decline this to use local Python installation.

I second the note above on declining the re-opening of container, for two reasons.
One it is just un-needed, and can make things more complicated then it has to be.
Two, even if you would want to try such and approach, the time it takes is so very long.

Tried it myself to the point that I was 30 minutes in and decided it was not worht the time spent, just to confirm the process was working correctly.


Once you have Visual Studio Code set up and open the main directory, and installed the Python Extension.
As you go through the documentation, you will see some snippets of code, it should allow you to run the snippet.

Visual Studio Code, will ask the first time of the session, which environment you want to run python in, make sure it is the one where the requirements.txt was installed into. If using the commands provided within the how to run, I believe the enviroment is ai4beg.

Once the snippet runs, you will see a checkmark below the snippet and the amount of seconds it took to run the snippet. This is how you know it ran correctly.

Remember, some of these snippets will install more packages, for example if you see a command that has the word pip most likely it is installing something, which is why it is important to choose the correct environment when requested originally.

You may run into more issues throughout some segments (I did not finish this course, so I do not know but it is not uncommon to run into issues when following courses which require haivng the correct enironment and multiple packages [Softwares]). When running into issues, don't be afraid to google the error and read upon what it might be and some of the fixes.
Just remember, if you are applying fixes, if you open a new terminal for Conda make sure you are either in the correct environment or you switch to the correct environment Before applying the fix, otherwise you will be applying it to the Default environment and you will not see it take affect when re-running the snippet.

I hope this answers a few things for you, or at least helps you a bit on continuing the course.

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