Can I use Python 3 for this course?

Dear all:

I am new to this course, and am eager to learn. My first question is can I use Python 3 for this course? The video says we should install Python 2.7.

Anyone has used Python 3 for this course? Thank you.

1 Like

Are you planning on using the amazon instance in the getting started lesson? It comes from theano installed with the python 2 distribution. You can use python 3, but if you see from the, the _future_ basically lets you write the code as if your were in python 3 if you were checking for syntax. Otherwise, if you’re using your own system, then python 3 should be fine.


Hi, herk:

Yes, I will follow the course materials and use amazon GPU machine. You mean Amazon machine only comes with Python 2 distribution, no Python 3?

“basically lets you write the code as if your were in python 3”: I am not quite clear about this. You mean I still should use Python 2, if I use Amazon machine? I can use Python 2 if I must; otherwise, I prefer Python 3. Thanks.

It comes with python 2 and python 3. Theano, however, is already installed with the Anaconda python 2 distribution.

“basically lets you write the code as if your were in python 3” just means that the future statements let the division and print statements act like python 3’s print and division. It might be easier to follow along with the stuff already installed.

Use python 2 unless you need something from python 3. You can install all the dependencies with python 3 though. I was trying to install theano on my windows PC, which has a Nvidia GPU too, but I ran into some problems. For some reason, tensorflow works, but Theano was a pain to get up and running.

1 Like

As @herk says, the AMI that we have provided comes with a scientific Python installation using Python version 2 set up. You will find life easier if you stick to using this preinstalled version, although if you are happy to install things yourself, there is no reason that version 3 will not work with a small minor changes to some of our scripts.

Hi, @jeremy, I think I may have some misunderstanding earlier. In this course we are actually going to work on the Amazon AWS machine, which will be pre-installed with Python 2 with the scripts you provided in the class. We don’t actually work on our own local machine. If that’s the case, I don’t need to bother using Python 3. I preferring Python 3 simply my local machine uses Python 3.

That sounds right. Glad we got it sorted out!

@herk, thanks for sharing your experience. How much is your Nvidia GPU? Can it be installed on a regular desktop?

I got theano running fine on windows - let me know if you want help.

@martin I’m currently using a Razer Blade laptop with a GeForce GTX 970M graphics card. It shouldn’t take too long to port over the required libraries to python 3 if you want to try playing with the libraries on your local machine as well.

@jeremy I got theano running. It turns out my problem was that my path variable was pointing to the cygwin build of g++ rather than the minGW verison. That was a pain to figure out, haha. Both tensorflow and theano with GPU acceleration are working fine now.

@Herk, That’s good to know. I am still waiting for Amazon to approve my request, which I submitted yesterday. If I just use my ‘regular’ desktop machine (8G RAM), do you think I can finish this course? Amazon seems very slow to process limit request.

@martin Yes. You should be able to finish the course on your desktop machine. If you don’t have an nvidia graphics card, you’ll have to use your cpu instead, which will still work. It might be a bit slower though. My Amazon request took two days to work out.

1 Like

FYI, I’ve found it easier to use VS2013 Community Edition with theano/GPU - that’s what they recommend on their site too.

1 Like

@jeremy / universe Is there anything I should be aware of if I want to use python 3 to complete the rest of the homework assignments on my own machine? (Since I’m not using the AWS scripts I’m only talking about code compatibility from the notebook)

The reason I’m interested is a bit long, so tldr: I want to use windows / python 3.5 ideally.

Why windows?
I’m doing VR development/gaming and the software isn’t too linux friendly yet. I get annoyed by changing operating systems, so, I’ve made efforts to setup a good environment with windows 10 / VS 2015. ( I didn’t see that 2013 was suggested, I’ll have too look into that, but my 2015 community edition install seems to be working fine so far.)

Why Tensor Flow?

I have multiple-GPU’s and I want to leverage all of them so I’m interested in using tensorflow over theano even if it has increased complexity. Or is a simpler choice to try and get theano to run on multiple gpus? As you have mentioned in the MOOC tensorflow seems the best choice for mGPU at the moment. They have added windows support for python 3.5 only as of ~nov 29th. I have setup a separate conda environment for TF and for’s stack. I’d like to just eliminate the 2.7 python install altogether if it’s all the same, I’m not too familiar with python and I’d like to focus on only one version initially.

I’ve set up my own machine with Anaconda and python 3. There were a couple of places where I needed to change print something to print(something) And a couple of other little things — can’t remember them right now, but I’m not very sophisticated in python 2 or 3 and didn’t take me long to figure them out.

I’ve only gone as far as Lesson 3, so maybe there will be something later, but so far python 3 seems to be working quite well.

Hi i just started this course, and am using Python 3, so far so good. There’s always the Future library to bridge to Python 2. There’s a few minor differences which I had to debug but its a good learning process!

Are you using anaconda 3? Are there any changes you made for keras 2.0 to work?

Yes i’m using the Anaconda distribution of Python 3. There’s afew changes i needed to modify to get the code from this course to work.

Generally speaking Keras has no problems working with Python 3. I believe, and I say this with a big ‘believe’, that the only compatibility risk here is that Cuda has not tested with Python 3 yet. I hope someone in this forum can please confirm or correct me?

I spent quite a while trying to get Lesson1 to work on Windows / Python 3.5 / GTX 970, with mixed results. I did get the code running with Theano but it does not seem to be taking advantage of CUDA (Theano gives an error during initialization about linking CUDA libs, and there’s no GPU activity in nvidia-smi) - I also tried installing Tensorflow and switching Keras to tensorflow + tf. But that just crashes the Python kernel so there’s something wrong there too.

In any case if I boot into Linux it all works great… but all my tools are in Windows so hopefully in the future these rough edges get ironed out. If I do get it working with CUDA, I will try to make notes of the steps.

1 Like

Has anyone managed to run the first lesson in Python 3.5 + Keras 2+ ?