Posts

Showing posts with the label linux

Deploy Symfony 5 on AWS Elastic Beanstalk with CI/CD, The right way of deploying Apps!

Image
I always thought that deploying an app on the server is quite easy! I mean sure you will have some errors, you may spend few hours trying to make things work on the server, you may even do different steps from setting up the server, setting up the database, make code changes, etc and as much as I always enjoyed doing that, we have to admit that this is only valid for small projects. Companies or even small startups are always making changes and adding new features, so it's not smart to waste time each time they want to deploy something new. You may have heard about CI before, maybe CI/CD, so let's see today how we can make things more professional. In this blog I will deploy a Symfony 5 project, same steps should be valid for any other framework, we just have to create our docker container file and make some changes like port mapping... In a more professional context, we should have 2 environments to deploy our app, an environment for production which have the stable ver...

Make Tensorflow use the GPU

Image
Hi, Today I was using Keras library with Tensorflow back end, I installed Tensorflow using this  documentation  (don't follow it the correct method is bellow) and I made sure to install the GPU version but when I was running my code it seemed that Tensorflow is using the CPU. After few minutes of Googling things up, I find a way to see if Tensorflow is using the CPU or the GPU by running this code in python : import tensorflow as tf hello = tf.constant( 'Hello, TensorFlow!' ) sess = tf.Session() print (sess.run(hello)) In my case I got an error : tensorflow.python.framework.errors_impl.InvalidArgumentError: Cannot assign a device for operation 'MatMul_1': Operation was explicitly assigned to /device:GPU:0 but available devices are [ /job:localhost/replica:0/task:0/cpu:0 ]. Make sure the device specification refers to a valid device.  Like the error shows : the GPU wasn't detected, the reason is that my graphics card driver (NVIDIA) wasn'...