I am trying to build a machine learning code with tensorflow 2.0 in jupyter using the mnist dataset . The data set is being taken from tensorflow-datasets but during the initial downloading of the dataset , after it downloads its showing an error that it is unable to rename the dataset and then aborting the whole process.
this is the line used for loading the dataset
mnist_dataset, mnist_info = tfds.load(name='mnist', with_info=True, as_supervised=True)
and this is the error
Downloading and preparing dataset mnist (11.06 MiB) to C:\Users\Main\tensorflow_datasets\mnist\1.0.0...
Dl Completed...:
0/0 [00:00<?, ? url/s]
Dl Size...:
0/0 [00:00<?, ? MiB/s]
Extraction completed...:
0/0 [00:00<?, ? file/s]
WARNING:tensorflow:From C:\Python38\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_datasets\core\file_format_adapter.py:209: tf_record_iterator (from tensorflow.python.lib.io.tf_record) is deprecated and will be removed in a future version.
Instructions for updating:
Use eager execution and:
`tf.data.TFRecordDataset(path)`
WARNING:tensorflow:From C:\Python38\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_datasets\core\file_format_adapter.py:209: tf_record_iterator (from tensorflow.python.lib.io.tf_record) is deprecated and will be removed in a future version.
Instructions for updating:
Use eager execution and:
`tf.data.TFRecordDataset(path)`
---------------------------------------------------------------------------
UnknownError Traceback (most recent call last)
<ipython-input-2-6bf2983938fb> in <module>
----> 1 mnist_dataset, mnist_info = tfds.load(name='mnist', with_info=True, as_supervised=True)
C:\Python38\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_datasets\core\api_utils.py in disallow_positional_args_dec(fn, instance, args, kwargs)
50 _check_no_positional(fn, args, ismethod, allowed=allowed)
51 _check_required(fn, kwargs)
---> 52 return fn(*args, **kwargs)
53
54 return disallow_positional_args_dec(wrapped) # pylint: disable=no-value-for-parameter
C:\Python38\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_datasets\core\registered.py in load(name, split, data_dir, batch_size, in_memory, shuffle_files, download, as_supervised, decoders, with_info, builder_kwargs, download_and_prepare_kwargs, as_dataset_kwargs, try_gcs)
298 if download:
299 download_and_prepare_kwargs = download_and_prepare_kwargs or {}
--> 300 dbuilder.download_and_prepare(**download_and_prepare_kwargs)
301
302 if as_dataset_kwargs is None:
C:\Python38\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_datasets\core\api_utils.py in disallow_positional_args_dec(fn, instance, args, kwargs)
50 _check_no_positional(fn, args, ismethod, allowed=allowed)
51 _check_required(fn, kwargs)
---> 52 return fn(*args, **kwargs)
53
54 return disallow_positional_args_dec(wrapped) # pylint: disable=no-value-for-parameter
C:\Python38\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_datasets\core\dataset_builder.py in download_and_prepare(self, download_dir, download_config)
305 self.info.size_in_bytes = dl_manager.downloaded_size
306 # Write DatasetInfo to disk, even if we haven't computed the statistics.
--> 307 self.info.write_to_directory(self._data_dir)
308 self._log_download_done()
309
C:\Python38\Anaconda3\envs\py3-TF2.0\lib\contextlib.py in __exit__(self, type, value, traceback)
117 if type is None:
118 try:
--> 119 next(self.gen)
120 except StopIteration:
121 return False
C:\Python38\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_datasets\core\file_format_adapter.py in incomplete_dir(dirname)
198 try:
199 yield tmp_dir
--> 200 tf.io.gfile.rename(tmp_dir, dirname)
201 finally:
202 if tf.io.gfile.exists(tmp_dir):
C:\Python38\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow\python\lib\io\file_io.py in rename_v2(src, dst, overwrite)
506 """
507 _pywrap_file_io.RenameFile(
--> 508 compat.as_bytes(src), compat.as_bytes(dst), overwrite)
509
510
UnknownError: Failed to rename: C:\Users\Main\tensorflow_datasets\mnist\1.0.0.incompleteI3ZU6X to: C:\Users\Main\tensorflow_datasets\mnist\1.0.0 : Access is denied.
; Input/output error
pip install -U tensorflow-datasets
didn't solve my problem. – Carmagnole