RStudio Server with Tensorflow-GPU for AWS

Hello!

I am having a problem with the RStudio Server with Tensorflow-GPU for AWS AMI. I subscribed to the product successfully and initiated an EC2 instance. RStudio also runs when called through the DNS. However, when I try to run Tensorflow/Keras, I get the following error:

> install_tensorflow()
Error: Prerequisites for installing TensorFlow not available.

Execute the following at a terminal to install the prerequisites:

$ sudo apt-get install python-virtualenv

> install_keras(tensorflow = "gpu")
Error: Prerequisites for installing TensorFlow not available.

Execute the following at a terminal to install the prerequisites:

$ sudo apt-get install python-virtualenv

I tried to run the sudo apt-get install python-virtualenv command in the server terminal - to no avail. How do I get this running??

Any help would be greatly appreciated!

1 Like

OK, so I just figured it out. I'll leave the solution here should anybody run into the same problem:

IF you get the above error, (1) make sure you know where your keypair.pem file for your AWS instance is
(2) open a Terminal (Mac) at the folder with the .pem file in it
(3) connect to your EC2 instance via ssh through your Terminal (see here). Instead of "root" use "ubuntu" as the user
(4) Run the command given by the error sudo apt-get install python-virtualenv
(5) Run exit in the Terminal to close the connection to the EC2 instance
(6) Done

Hope this helps!!

Hi @Primesty!

Because the default username/password combination offered to you in the Marketplace instructions are quite insecure, we opted to make that user (rstudio-user) not a sudoer, so you wont be able able to perform sudo operations from the rstudio-server terminal by default.

Obviously, you've discovered that the default ubuntu user for this instance is, as the Ubuntu AMI standard, capable of performing sudo tasks.

In addition, the TensorFlow-GPU AMI does actually come with tensorflow-gpu installed in the default python environment (and even has the tensorflow/keras R packages installed with all existing R versions). I imagine you were looking to do something a little more nuanced with the tensorflow install, which is perfectly alright! Please let us know though if you had trouble using the default set of tensorflow tools installed in the AMI, we'd love to make this offering work great for everyone!

Thanks!
Steve

2 Likes

Hi Steve,

Thanks for getting back to me about this! I terminated my AWS p2.xlarge instance and set it up again via the RStudio Server with Tensorflow-GPU for AWS marketplace AMI set up. This time it worked like a charm.

I think the first time I ran the install_keras(tensorflow = "gpu") command and that messed it up, seeing as it is already installed. So just running library(keras) does the trick!!

I'm following Chollet and Allaire's deep learning with R book. Initially, I couldn't even run the examples, because I would get the above error. Now, everything seems to be working fine.

Thanks again!

Matthias

2 Likes

@Primesty -- i've been following your walkthrough blog post on this, but you leave out some critical info on how to connect. So here you mention that you SSH'd in using unbuntu@
ok that (finally after specifically opening port 22) worked for me, but then what?
Copying that dns into the browser with port 8787 times out.

Sorry I kinda double posted on another thread about this.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.