Following error arises after installing TensorFlow in Ubuntu 22.04, request anyone to throw some light to fix this issue(error details added below). Thanks in advance.
$ python3 -c “import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))”
2023-07-21 16:58:48.171036: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2023-07-21 16:58:48.230884: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2023-07-21 16:58:48.231404: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
Traceback (most recent call last):
File “”, line 1, in
File “/home/surya/miniconda3/envs/myenv/lib/python3.11/site-packages/tensorflow/init.py”, line 38, in
from tensorflow.python.tools import module_util as _module_util
File “/home/surya/miniconda3/envs/myenv/lib/python3.11/site-packages/tensorflow/python/init.py”, line 37, in
from tensorflow.python.eager import context
File “/home/surya/miniconda3/envs/myenv/lib/python3.11/site-packages/tensorflow/python/eager/context.py”, line 36, in
from tensorflow.python.eager import execute
File “/home/surya/miniconda3/envs/myenv/lib/python3.11/site-packages/tensorflow/python/eager/execute.py”, line 23, in
from tensorflow.python.framework import tensor_shape
File “/home/surya/miniconda3/envs/myenv/lib/python3.11/site-packages/tensorflow/python/framework/tensor_shape.py”, line 26, in
from tensorflow.python.saved_model import nested_structure_coder
File “/home/surya/miniconda3/envs/myenv/lib/python3.11/site-packages/tensorflow/python/saved_model/nested_structure_coder.py”, line 38, in
from tensorflow.python.util import nest
File “/home/surya/miniconda3/envs/myenv/lib/python3.11/site-packages/tensorflow/python/util/nest.py”, line 86, in
import wrapt as _wrapt
File “/home/surya/miniconda3/envs/myenv/lib/python3.11/site-packages/wrapt/init.py”, line 10, in
from .decorators import (adapter_factory, AdapterFactory, decorator,
File “/home/surya/miniconda3/envs/myenv/lib/python3.11/site-packages/wrapt/decorators.py”, line 34, in
from inspect import ismethod, isclass, formatargspec
ImportError: cannot import name ‘formatargspec’ from ‘inspect’ (/home/surya/miniconda3/envs/myenv/lib/python3.11/inspect.py)