There could be the problem with supported package version mismatch in the anaconda environment. You can try by restarting the kernel after sometime or can rectify this error by creating a new environment and install the TensorFlow and other required packages again on that.
Create a new environment for TensorFlow using the code below:
conda create -n tf tensorflow
conda activate tf
and insatll TensorFlow:
conda install pip
pip install tensorflow
You need to open the JUPYTER notebook in the same environment by selecting the "tf2" and try importing TensorFlow :
import tensorflow as tf
print(tf.__version__)
if there is no error - TensorFlow installed successfully.
Now, you can install any reuired package using !pip install package_name in Jupyter Notebook, as in this case:
!pip install imageai
Also check this link as a reference for using imageai