PaddleGAN icon indicating copy to clipboard operation
PaddleGAN copied to clipboard

unexpected end of data while downloading the pdparam for EDVRPredictor

Open franva opened this issue 4 years ago • 1 comments

I am in Australia and would like to use Paddle as well. It seems that the downloading of the pdparam file always too slow and ends up without downloading the full file which is indicated by the progress bar: 81920/82300, which leads to the unexpected end of data.

Are we thinking of adding some CDN for overseas users to speed up the downloading?
I have enrolled in 2 classes and hopefully I could use it in my project.

How to reproduce:

import paddle
paddle.set_device('gpu')

from ppgan.apps import EDVRPredictor
sr = EDVRPredictor()

frame_path, video_path = sr.run("video/result/TheProfessor.mp4")

[04/23 00:44:22] ppgan INFO: Downloading edvr_infer_model.tar from https://paddlegan.bj.bcebos.com/applications/edvr_infer_model.tar to /home/winstonfan/.cache/ppgan/edvr_infer_model.tar

100%|█████████▉| 81920/82300 [28:12<00:07, 48.39it/s]

[04/23 01:12:37] ppgan INFO: Decompressing /home/winstonfan/.cache/ppgan/edvr_infer_model.tar...

---------------------------------------------------------------------------
ReadError                                 Traceback (most recent call last)
<ipython-input-6-42021b04bd7a> in <module>
----> 1 sr = EDVRPredictor()
      2 
      3 frame_path, video_path = sr.run("video/result/TheProfessor.mp4")

~/anaconda3/envs/paddle/lib/python3.8/site-packages/ppgan/apps/edvr_predictor.py in __init__(self, output, weight_path)
    139 
    140         if weight_path is None:
--> 141             weight_path = get_path_from_url(EDVR_WEIGHT_URL)
    142 
    143         self.weight_path = weight_path

~/anaconda3/envs/paddle/lib/python3.8/site-packages/ppgan/utils/download.py in get_path_from_url(url, md5sum, check_exist)
     84     if ParallelEnv().local_rank == 0:
     85         if tarfile.is_tarfile(fullpath) or zipfile.is_zipfile(fullpath):
---> 86             fullpath = _decompress(fullpath)
     87 
     88     return fullpath

~/anaconda3/envs/paddle/lib/python3.8/site-packages/ppgan/utils/download.py in _decompress(fname)
    170 
    171     if tarfile.is_tarfile(fname):
--> 172         uncompressed_path = _uncompress_file_tar(fname)
    173     elif zipfile.is_zipfile(fname):
    174         uncompressed_path = _uncompress_file_zip(fname)

~/anaconda3/envs/paddle/lib/python3.8/site-packages/ppgan/utils/download.py in _uncompress_file_tar(filepath, mode)
    215 def _uncompress_file_tar(filepath, mode="r:*"):
    216     files = tarfile.open(filepath, mode)
--> 217     file_list = files.getnames()
    218 
    219     file_dir = os.path.dirname(filepath)

~/anaconda3/envs/paddle/lib/python3.8/tarfile.py in getnames(self)
   1797            the same order as the list returned by getmembers().
   1798         """
-> 1799         return [tarinfo.name for tarinfo in self.getmembers()]
   1800 
   1801     def gettarinfo(self, name=None, arcname=None, fileobj=None):

~/anaconda3/envs/paddle/lib/python3.8/tarfile.py in getmembers(self)
   1789         self._check()
   1790         if not self._loaded:    # if we want to obtain a list of
-> 1791             self._load()        # all members, we first have to
   1792                                 # scan the whole archive.
   1793         return self.members

~/anaconda3/envs/paddle/lib/python3.8/tarfile.py in _load(self)
   2377         """
   2378         while True:
-> 2379             tarinfo = self.next()
   2380             if tarinfo is None:
   2381                 break

~/anaconda3/envs/paddle/lib/python3.8/tarfile.py in next(self)
   2310             self.fileobj.seek(self.offset - 1)
   2311             if not self.fileobj.read(1):
-> 2312                 raise ReadError("unexpected end of data")
   2313 
   2314         # Read the next block.

ReadError: unexpected end of data


franva avatar Apr 22 '21 14:04 franva

你可以试试手动将权重保存到 https://paddlegan.bj.bcebos.com/applications/edvr_infer_model.tar to /home/winstonfan/.cache/ppgan/edvr_infer_model.tar 这个位置,并解压

LielinJiang avatar May 10 '21 06:05 LielinJiang

问题过于久远,如果有图像和视频生成的需求,可以使用新的跨模态工具: https://github.com/PaddlePaddle/PaddleMIX/tree/develop

JunnYu avatar Feb 29 '24 03:02 JunnYu