Redfield BERT Nodes

I’m trying to use the Redfield BERT Nodes and get the following error. I Installed the Python BERT-Tensorflow package, but Knime can’t seem to find it. I’m an amateur with Python, so I may be doing something wrong. I’m using Anaconda/

ERROR BERT Model Selector 0:171 Execute failed: An error occurred while trying to launch Python: Could not start Python kernel. Error during Python installation test: Library bert is missing.
2020-12-12 11:10:57.369352: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library ‘cudart64_101.dll’; dlerror: cudart64_101.dll not found
2020-12-12 11:10:57.369370: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

Looks like you are missing the BERT library in your conda environment. Please refer to this blogpost to see which libraries are needed to run the BERT nodes: https://www.knime.com/blog/bert-text-classification-for-everyone#Installation

1 Like

I manually installed all of the packages listed in the blog you mentioned and still get the same error message. Here’s the installation for the BERT package:

(base) C:\Users\genef>pip install bert==2.2.0
Requirement already satisfied: bert==2.2.0 in c:\users\genef\anaconda3\lib\site-packages (2.2.0)
Requirement already satisfied: erlastic in c:\users\genef\anaconda3\lib\site-packages (from bert==2.2.0) (2.0.0)

I can’t find cudart64_101.dll anywhere on my system. do I need to do something to install it?

Hello @rfeigel,

It seems that you are trying to use GPU to run the code. In order to do this you need to install additional software for your GPU, basically you need to install CUDA and neural network processing libraries for it.
In our tests we used libcudNN 7.6.5 and CUDA 10.1. I would recommend you to use these versions. However feel free to try some other, I would be glad to know if there are other versions of CUDA software that makes it possible to run the code.

Unfortunately this process might be tedious and we can do nothing about it.

Best regards,
Artem.

1 Like

I don’t have a GPU on my laptop. I have a Intel Core i7 10th GEN CPU. I saw a switch somewhere to toggle off GPU, but can’t find it now.

Then you should probably create another CPU-based environment for deep learning. However using such a computationally expensive model as BERT might take eternity with CPU.

Anyway, if you are looking for a switch to force CPU usage it is here:
image

Best regards,
Artem.

I do have an NVIDIA GPU, albeit low level (GeForce MN250.) I installed CUDA and am still getting the same error message:

ERROR BERT Model Selector 0:171 Execute failed: An error occurred while trying to launch Python: Could not start Python kernel. Error during Python installation test: Library bert is missing.
2020-12-16 16:55:19.086542: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library ‘cudart64_101.dll’; dlerror: cudart64_101.dll not found
2020-12-16 16:55:19.086562: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

Here are screen shots of the CUDA and Anaconda BERT installations. I’m lost.

Sorry GPU is MX250 not MN250.

Are you sure you have installed the package to the Python environment you use for TensorFlow in Knime?
Since based on your message:

(base) C:\Users\genef>pip install bert==2.2.0

it feels that this is a separate environment.

Regarding the CUDA related problem. Unfortunately CUDA installation might not be very clear and straightforward, but probably you could try to re-install CUDA and the related libraries.
I have also found these solutions for a similar problem, I hope they might be useful for you:


Please also pay attention to use CUDA 10.1 and libcudNN 7.6.5, since these are the versions we used for developing and testing the nodes.

I Have used the tensorflow 2 integretion using cpu also but I keep getting this error

Could u please clarify i hav been trying for a very long time

Hello @sms

As you stated you are using TensorFlow 2 running on CPU. Does it work?
If it works, than you can probably ignore this message that is related to CUDA and GPU as long as you are not planning to use TF2 on GPU.

Could you also please provide a full error message/log, since I can see that this is not a full error message. It seems that Python cannot start for some reason, but I cannot see this reason.

1 Like

@Redfield i have tried solving that …now im getting another error from BERT classification learner node.
It is not able to import bert_tokenization

It seems that you are missing some Python packages in you Deep Learning python environment in Knime. Please install all packages mentioned here:

2 Likes

@Redfield everything is working fine on CPU. But for GPU there is a lot of problem if we want to use the bert nodes. The versions are not compatible
Redfield bert node - tensorflow version 2.2.0 (required)
Tensorflow 2.2.0 - Requires CUDA 10.1 according to official website
Where as CUDA 10.1 is not compatible with KNIME.
What to do now @Redfield if I want to use the bert nodes with gpu

Hello @sms

I did a small investigation and tried to update CUDA. It seems that extension is compatible with CUDA 11.0. The TensorFlow version I used was 2.2.0. However feel free to try a newer one.

I also did not understand your point about CUDA and Knime compatibility. CUDA is a low-lever software compared to Knime, moreover Knime does not communicate with CUDA directly since CUDA libraries are used in Python while execution of BERT related Python code.

Hello @sms
We did some investigation and found out that the extension is dependent on OS and packages version for the OS.
In case you are using Windows please try to install these packages to make extension working.

bert==2.2.0
bert-for-tf2==0.14.7
h5py==2.10.0
Keras-Preprocessing==1.1.2
numpy==1.19.4
pandas==0.23.4
pyarrow==0.11.1
tensorboard==2.2.2
tensorboard-plugin-wit==1.7.0
tensorflow==2.2.0
tensorflow-estimator==2.2.0
tensorflow-hub==0.8.0
tokenizers==0.9.2
tqdm==4.51.0
transformers==3.4.0

1 Like