导入tensorflow_datasets

问题描述 投票:0回答:1

我正在尝试导入tensorflow_datasets以加载数据集,但是我发现我应该使用pip或conda安装tensorflow_datasets。我使用两种方法都安装了两次。但是tensorflow_datasets在jupyter笔记本中仍然不起作用。在最后一次尝试中,我收到以下错误:ImportError: cannot import name 'kwarg_only' from 'tensorflow.python.util.tf_export'

Failed to import TensorFlow. Please note that TensorFlow is not installed by default when you install TensorFlow Datasets. This is so that users can decide whether to install the GPU-enabled TensorFlow package. To use TensorFlow Datasets, please install the most recent version of TensorFlow, by following instructions at https://tensorflow.org/install.

虽然我已安装tesnorflow。我在网上搜索,但没有一种解决方案可以解决问题。希望得到任何帮助。

install tensorflow-datasets
1个回答
0
投票

尝试创建一个单独的环境,然后使用pip install tensorflow==2.0.0pip install tensorflow_datasets==2.1.0安装tensorflow和tensorflow_datasets。它的工作正常。

© www.soinside.com 2019 - 2024. All rights reserved.