emla2805 / vision-transformer

Tensorflow implementation of the Vision Transformer (An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale)
https://openreview.net/pdf?id=YicbFdNTTy
206 stars 63 forks source link

download error #4

Open mouni13r opened 3 years ago

mouni13r commented 3 years ago

this model is giving me arror when I update the embedding dimension to 512 and MLP dimension to 512. can you please look into this

ashishpatel26 commented 2 years ago

Downloading and preparing dataset Unknown size (download: Unknown size, generated: Unknown size, total: Unknown size) to C:\Users\SHIVA\tensorflow_datasets\imagenet_resized\32x32\0.1.0... Dl Size...: 0 MiB [00:01, ? MiB/s] Dl Completed...: 0%| | 0/2 [00:01<?, ? url/s]

---------------------------------------------------------------------------
DownloadError                             Traceback (most recent call last)
<ipython-input-14-6cc7bc3ff103> in <module>
----> 1 ds = tfds.load("imagenet_resized/32x32", as_supervised=True)
      2 ds_train = (ds["train"].cache().shuffle(5 * config.batch_size).batch(config.batch_size).prefetch(AUTOTUNE))
      3 ds_test = (ds["validation"].cache().batch(config.batch_size).prefetch(AUTOTUNE))

~\miniconda3\envs\tf_gpu_251\lib\site-packages\tensorflow_datasets\core\load.py in load(name, split, data_dir, batch_size, shuffle_files, download, as_supervised, decoders, read_config, with_info, builder_kwargs, download_and_prepare_kwargs, as_dataset_kwargs, try_gcs)
    316   if download:
    317     download_and_prepare_kwargs = download_and_prepare_kwargs or {}
--> 318     dbuilder.download_and_prepare(**download_and_prepare_kwargs)
    319 
    320   if as_dataset_kwargs is None:

~\miniconda3\envs\tf_gpu_251\lib\site-packages\tensorflow_datasets\core\dataset_builder.py in download_and_prepare(self, download_dir, download_config)
    437           # Old version of TF are not os.PathLike compatible
    438           with tf_compat.mock_gfile_pathlike():
--> 439             self._download_and_prepare(
    440                 dl_manager=dl_manager,
    441                 download_config=download_config,

~\miniconda3\envs\tf_gpu_251\lib\site-packages\tensorflow_datasets\core\dataset_builder.py in _download_and_prepare(self, dl_manager, download_config)
   1111       else:
   1112         optional_pipeline_kwargs = {}
-> 1113       split_generators = self._split_generators(  # pylint: disable=unexpected-keyword-arg
   1114           dl_manager, **optional_pipeline_kwargs)
   1115       # TODO(tfds): Could be removed once all datasets are migrated.

~\miniconda3\envs\tf_gpu_251\lib\site-packages\tensorflow_datasets\image_classification\imagenet_resized.py in _split_generators(self, dl_manager)
     98 
     99     if size in [8, 16, 32]:
--> 100       train_path, val_path = dl_manager.download([
    101           '%s/Imagenet%d_train_npz.zip' % (_URL_PREFIX, size),
    102           '%s/Imagenet%d_val_npz.zip' % (_URL_PREFIX, size)

~\miniconda3\envs\tf_gpu_251\lib\site-packages\tensorflow_datasets\core\download\download_manager.py in download(self, url_or_urls)
    547     # Add progress bar to follow the download state
    548     with self._downloader.tqdm():
--> 549       return _map_promise(self._download, url_or_urls)
    550 
    551   def iter_archive(

~\miniconda3\envs\tf_gpu_251\lib\site-packages\tensorflow_datasets\core\download\download_manager.py in _map_promise(map_fn, all_inputs)
    765   """Map the function into each element and resolve the promise."""
    766   all_promises = tf.nest.map_structure(map_fn, all_inputs)  # Apply the function
--> 767   res = tf.nest.map_structure(lambda p: p.get(), all_promises)  # Wait promises
    768 
    769   return res

~\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\util\nest.py in map_structure(func, *structure, **kwargs)
    867 
    868   return pack_sequence_as(
--> 869       structure[0], [func(*x) for x in entries],
    870       expand_composites=expand_composites)
    871 

~\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\util\nest.py in <listcomp>(.0)
    867 
    868   return pack_sequence_as(
--> 869       structure[0], [func(*x) for x in entries],
    870       expand_composites=expand_composites)
    871 

~\miniconda3\envs\tf_gpu_251\lib\site-packages\tensorflow_datasets\core\download\download_manager.py in <lambda>(p)
    765   """Map the function into each element and resolve the promise."""
    766   all_promises = tf.nest.map_structure(map_fn, all_inputs)  # Apply the function
--> 767   res = tf.nest.map_structure(lambda p: p.get(), all_promises)  # Wait promises
    768 
    769   return res

~\miniconda3\envs\tf_gpu_251\lib\site-packages\promise\promise.py in get(self, timeout)
    510         target = self._target()
    511         self._wait(timeout or DEFAULT_TIMEOUT)
--> 512         return self._target_settled_value(_raise=True)
    513 
    514     def _target_settled_value(self, _raise=False):

~\miniconda3\envs\tf_gpu_251\lib\site-packages\promise\promise.py in _target_settled_value(self, _raise)
    514     def _target_settled_value(self, _raise=False):
    515         # type: (bool) -> Any
--> 516         return self._target()._settled_value(_raise)
    517 
    518     _value = _reason = _target_settled_value

~\miniconda3\envs\tf_gpu_251\lib\site-packages\promise\promise.py in _settled_value(self, _raise)
    224             if _raise:
    225                 raise_val = self._fulfillment_handler0
--> 226                 reraise(type(raise_val), raise_val, self._traceback)
    227             return self._fulfillment_handler0
    228 

~\miniconda3\envs\tf_gpu_251\lib\site-packages\six.py in reraise(tp, value, tb)
    701             if value.__traceback__ is not tb:
    702                 raise value.with_traceback(tb)
--> 703             raise value
    704         finally:
    705             value = None

~\miniconda3\envs\tf_gpu_251\lib\site-packages\promise\promise.py in handle_future_result(future)
    842         # type: (Any) -> None
    843         try:
--> 844             resolve(future.result())
    845         except Exception as e:
    846             tb = exc_info()[2]

~\miniconda3\envs\tf_gpu_251\lib\concurrent\futures\_base.py in result(self, timeout)
    430                 raise CancelledError()
    431             elif self._state == FINISHED:
--> 432                 return self.__get_result()
    433 
    434             self._condition.wait(timeout)

~\miniconda3\envs\tf_gpu_251\lib\concurrent\futures\_base.py in __get_result(self)
    386     def __get_result(self):
    387         if self._exception:
--> 388             raise self._exception
    389         else:
    390             return self._result

~\miniconda3\envs\tf_gpu_251\lib\concurrent\futures\thread.py in run(self)
     55 
     56         try:
---> 57             result = self.fn(*self.args, **self.kwargs)
     58         except BaseException as exc:
     59             self.future.set_exception(exc)

~\miniconda3\envs\tf_gpu_251\lib\site-packages\tensorflow_datasets\core\download\downloader.py in _sync_download(self, url, destination_path, verify)
    214       pass
    215 
--> 216     with _open_url(url, verify=verify) as (response, iter_content):
    217       fname = _get_filename(response)
    218       path = os.path.join(destination_path, fname)

~\miniconda3\envs\tf_gpu_251\lib\contextlib.py in __enter__(self)
    111         del self.args, self.kwds, self.func
    112         try:
--> 113             return next(self.gen)
    114         except StopIteration:
    115             raise RuntimeError("generator didn't yield") from None

~\miniconda3\envs\tf_gpu_251\lib\site-packages\tensorflow_datasets\core\download\downloader.py in _open_with_requests(url, **kwargs)
    276       url = _get_drive_url(url, session)
    277     with session.get(url, stream=True, **kwargs) as response:
--> 278       _assert_status(response)
    279       yield (response, response.iter_content(chunk_size=io.DEFAULT_BUFFER_SIZE))
    280 

~\miniconda3\envs\tf_gpu_251\lib\site-packages\tensorflow_datasets\core\download\downloader.py in _assert_status(response)
    307   """Ensure the URL response is 200."""
    308   if response.status_code != 200:
--> 309     raise DownloadError('Failed to get url {}. HTTP code: {}.'.format(
    310         response.url, response.status_code))

DownloadError: Failed to get url https://image-net.org/image/downsample/Imagenet32_train_npz.zip. HTTP code: 404.