Issue Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA - linux

I met this issue when I running my python file in linux.
I searched some answers in google like use the code below:
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
The system can be running but without ant out information. Actually I found the 2 measn ignore all information while 1 means give all information like error or normal output.
because I need to use GPU so my original code is:
os.environ["CUDA_VISIBLE_DEVICES"]="0"
But if I keep the code my output would be an error information like the title.
How can I do? and of course I need use the GPU and the codes can be running in colab which indicated that my code has no problem.
some guys even said uninstall tensorboard...that must a wrong way.
Or should I download tensorflow gpu not tensorflow in m,y virtual enviroment? when I USE THE tensorflow gpu version, the error is core dumped.

If when forcing the os.environ["CUDA_VISIBLE_DEVICES"]="0" doesn't work, then this means that your tensorflow gpu installation did not succeed. You must ensure you have the right combination of TensorFlow + CUDA + CUDNN. That is why you get the error, because due to improper versions/installation TF falls back on CPU.

Related

FAISS search fails with vague error: "Illegal instruction" or kernel crash

Currently trying to run a basic similarity search via FAISS with reproducible code from that link. However, every time I run the code in the following venues, I have these problems:
Jupyter notebook - kernel crashes
VS Code - receive "Illegal Instruction" message in the terminal with no further documentation
I've got similar code working in Kaggle, so I suppose the problem is with my particular setup.
Based on the print statements, it appears that the error occurs during the call of the .search method. Because of how vague this error is, I've not been able to find much information on the problem. It seems that some people mentioned older processors may have a problem (AVX/AVX2 flags being the culprit?), though admittedly I didn't quite understand the connections.
Problem: Can I get some help understanding this error, and if possible, a potential solution?
Current setup:
WSL2
VSCODE (v. 1.49.0)
Jupyter-client (v. 6.1.7)
Jupyter-core (v. 4.6.3)
FAISS-cpu (v. 1.6.3)
Numpy (v. 1.19.2)
Older machine (AMD FX-8350 with 16GB RAM)
For anyone that runs across this error, the problem (in my case) was that my CPU was old enough that it doesn't support AVX2. To determine this, I used this SO post.
Once I ran the code in Colab or on a newer machine, all was well.

Anaconda Kernel and Google Colab crash when using cv2.FastFeatureDetector()

I am trying to use the cv2.FastFeatureDetector() method and everytime i run this code to extract features my kernel in both Google Collab and Anaconda crashes for some reason. Initially I thought it was memory management issue with my system, but the same thing is happening in Colab.
import cv2
import numpy as np
image=cv2.imread('tree.jpg',0)
fast=cv2.FastFeatureDetector()
keypoints=fast.detect(image,None)
#After running this code my kernel crashes
There is no error message due to the kernel crash.
The image is fairly small in size and not that computationally expensive.
Here is the image:
https://www.setaswall.com/wp-content/uploads/2017/06/Sun-Tree-Branches-1920-x-1080.jpg
I had the same problem. With newer OpenCV versions you have to create your detector via fast = cv2.FastFeatureDetector_create(). Note that you might have to adjust the rest of your code due to other API changes.

Run Tensorflow in Qubole

I am trying to train LSTM using Spark python Notebook in Qubole. When I try to fit model, I received below error.
I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX
Why this error occur and how can I overcome this?
This is not an error, but a warning. The pre-built tensorflow binaries are not compiled with various CPU instruction extensions because not everyone has them. When TensorFlow is started, it checks which extensions are available on your machine and which ones the binary was compiled with. If your machine has some extensions that the binary was not compiled with, it lets you know this. If you do a lot of CPU computation and care about ultimate performance, you can build tensorflow yourself with extensions present on your machine.

Theano Installation On windows 64

Im new in Python and Theano library. I want to install Theano on windows 7-64. I have a display adapters :
Intel(R) HD Graphics 3000 which is not compatible with NVIDA.
My QUESTIONS:
1-Is obligatory to install CUDA to i can use Theano?
2- Even if i have an Ubuntu opearting system, with the same display adapters, CUDA still mandatory?
Any help!
Thanks
You do not need CUDA to run Theano.
Theano can run on either CPU or GPU. If you want to run on GPU you must (currently) use CUDA which means you must be using a NVIDIA display adapter. Without CUDA/NVIDIA you must run on CPU.
There is no disadvantage to running on CPU other than speed -- Theano can be much faster on GPU but everything that runs on a GPU will also run on a CPU as long as it has been coded generically (the default and standard method for Theano code).

Error OpenCV with CUDA using TBB for multiple GPUs

My OpenCV CUDA program runs fine using a single NVidia 580GTX, but when using another, it gives the following error:
OpenCV Error: Gpu API call (invalid device ordinal) in mallocPitch
I know I need TBB to assign a GPU its job, but even though I installed OpenCV with TBB support (followed the willowgarage website), it says TBB support is required (CMake key 'WITH_TBB' must be true). Any help would really be appreciated since I need this to complete my computer science Master's project.
Thanks!
Ok its solved. turns out it was build 7232 that was the problem, since it works with the latest opencv build(7292) with no problems. Thanks all for the support

Resources