I'm using TensorFlow but I'm getting the following warning
The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations
I installed it using pip.
How can I fix it?
It's because you installed using pip it's a precompiled package that wasn't precompiled to the architecture you use, you need to build it from the source.
You can refer to he official tensorflow documentation on how to compile it from the source