在 Colab 中执行联邦学习文本生成教程时出错
Error while executing federated learning text generation tutorial in Colab
我正在尝试在联合学习 TensorFlow 上遵循此 tutorial,但在执行此行时出现错误:
train_data, test_data = tff.simulation.datasets.shakespeare.load_data()
错误:
Downloading shakespeare.sqlite.lzma: 79%|███████▉ | 1048576/1329828 [00:00<00:00, 12187174.26it/s]
---------------------------------------------------------------------------
NotFoundError Traceback (most recent call last)
<ipython-input-12-f8f1fc62c096> in <module>()
----> 1 train_data, test_data = tff.simulation.datasets.shakespeare.load_data()
4 frames
/usr/local/lib/python3.6/dist-packages/tensorflow/python/lib/io/file_io.py in _prewrite_check(self)
86 "File isn't open for writing")
87 self._writable_file = _pywrap_file_io.WritableFile(
---> 88 compat.path_to_bytes(self.__name), compat.as_bytes(self.__mode))
89
90 def _prepare_value(self, val):
NotFoundError: /root/.tff/shakespeare.sqlite; No such file or directory
enter image description here
这是当前 tensorflow-federated-nightly
pip 包的问题。它应该由 https://github.com/tensorflow/federated/pull/1162.
修复
同时,尝试将第一个单元格中的 pip install
更改为使用 tensorflow-federated
包而不是 nightly 包。示例:
!pip install --quiet --upgrade tensorflow_federated
!pip install --quiet --upgrade nest_asyncio
import nest_asyncio
nest_asyncio.apply()
我正在尝试在联合学习 TensorFlow 上遵循此 tutorial,但在执行此行时出现错误:
train_data, test_data = tff.simulation.datasets.shakespeare.load_data()
错误:
Downloading shakespeare.sqlite.lzma: 79%|███████▉ | 1048576/1329828 [00:00<00:00, 12187174.26it/s]
---------------------------------------------------------------------------
NotFoundError Traceback (most recent call last)
<ipython-input-12-f8f1fc62c096> in <module>()
----> 1 train_data, test_data = tff.simulation.datasets.shakespeare.load_data()
4 frames
/usr/local/lib/python3.6/dist-packages/tensorflow/python/lib/io/file_io.py in _prewrite_check(self)
86 "File isn't open for writing")
87 self._writable_file = _pywrap_file_io.WritableFile(
---> 88 compat.path_to_bytes(self.__name), compat.as_bytes(self.__mode))
89
90 def _prepare_value(self, val):
NotFoundError: /root/.tff/shakespeare.sqlite; No such file or directory
enter image description here
这是当前 tensorflow-federated-nightly
pip 包的问题。它应该由 https://github.com/tensorflow/federated/pull/1162.
同时,尝试将第一个单元格中的 pip install
更改为使用 tensorflow-federated
包而不是 nightly 包。示例:
!pip install --quiet --upgrade tensorflow_federated
!pip install --quiet --upgrade nest_asyncio
import nest_asyncio
nest_asyncio.apply()