Nipun Ravisara
Nipun Ravisara

Reputation: 4471

Tensorflow installation killed on AWS ec2 instance

I'm trying to use AWS EC2 instance for to test my ML project. During the package installation process of TensorFlow getting kills every time.

I'm using AWS trial EC2 t2.micro type instance for my testing purposes.

enter image description here

Is there any soulutions for this?

Upvotes: 4

Views: 4943

Answers (8)

Amit Khullar
Amit Khullar

Reputation: 1

Increasing size of /tmp mount solved my issue :

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        4.0M     0  4.0M   0% /dev
tmpfs           475M     0  475M   0% /dev/shm
tmpfs           190M  464K  190M   1% /run
/dev/xvda1      8.0G  1.8G  6.3G  22% /
**tmpfs           475M  217M  259M  46% /tmp**
/dev/xvda128     10M  1.3M  8.7M  13% /boot/efi
tmpfs            95M     0   95M   0% /run/user/1000
/dev/xvdb        30G  329M   30G   2% /data

$ sudo mount -o remount,size=2048M /tmp

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        4.0M     0  4.0M   0% /dev
tmpfs           475M     0  475M   0% /dev/shm
tmpfs           190M  464K  190M   1% /run
/dev/xvda1      8.0G  1.8G  6.3G  22% /
**tmpfs           2.0G     0  2.0G   0% /tmp**
/dev/xvda128     10M  1.3M  8.7M  13% /boot/efi
tmpfs            95M     0   95M   0% /run/user/1000
/dev/xvdb        30G  329M   30G   2% /data

Upvotes: 0

user3242360
user3242360

Reputation: 1

For me, running:

pip3 install tensorflow-cpu --no-cache-dir

Fixed it on the free tier

Upvotes: 0

Codemaker2015
Codemaker2015

Reputation: 15649

Use --no-cache-dir argument with the pip installation command to resolve the tensorflow installation killed issue in aws ec2 instances.

pip3 install tensorflow --no-cache-dir

enter image description here

Upvotes: 4

Sarthak Akre
Sarthak Akre

Reputation: 1

I had the same issue and pip install tensorflow-cpu was also getting killed. I used pip3 install tensorflow-cpu --no-cache-dir which worked.

Upvotes: 0

Dinesh Raj
Dinesh Raj

Reputation: 31

It can be fixed with the following command:

pip install tensorflow-cpu

instead of just:

pip install tensorflow

Upvotes: 3

marsolmos
marsolmos

Reputation: 794

I had the exact same problem, and I finally fixed it by doing the following:

  • Using free tier instance, but with 25 Gib of hard disk storage (currently, free tier covers up to 30 Gib without extra cost)
  • Install tensorflow by running pip install tensorflow-cpu instead of just pip install tensorflow

Upvotes: 7

Nipun Ravisara
Nipun Ravisara

Reputation: 4471

Found out that the issues is I have not enough space in my EC2 instance. By running this command.

sudo pip install --cache-dir=/data/jimit/ --build /data/jimit/ tensorflow TMPDIR==/data/jimit/

It outputs below error.

ERROR: Could not install packages due to an EnvironmentError: [Errno 28] No space left on device

Found it here. Cradits to @bigmac

Upvotes: 0

bigmac
bigmac

Reputation: 145

It is difficult to state an exact memory requirement for installing Tensorflow and its dependencies, but most likely this instance size is too small. You could verify it works with a larger instance and/or try this

Upvotes: 1

Related Questions