Skip to content

AttributeError: 'str' object has no attribute 'read' #79

@HanLiii

Description

@HanLiii

Processing chunk 1 / 2
t0 = 881 t1 = 941_model.safetensors: 100%|███████████████████████████████████████████| 167M/167M [00:03<00:00, 59.8MB/s]
0%| | 0/50 [00:00<?, ?it/s]Continue DDIM with i = 0, t = 981, latent = torch.Size([1, 4, 64, 64]), device = cuda:0, type = torch.float16
2%|█▋ | 1/50 [00:09<07:46, 9.52s/it]latent t1 found at i=1, t = 961
8%|██████▋ | 4/50 [00:09<01:11, 1.55s/it]latent t0 found at i = 4, t = 901
100%|███████████████████████████████████████████████████████████████████████████████████| 50/50 [00:14<00:00, 3.48it/s]
/home/hanli/anaconda3/envs/t2vzero/lib/python3.9/site-packages/torch/functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3190.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
/home/hanli/anaconda3/envs/t2vzero/lib/python3.9/site-packages/torch/nn/functional.py:4227: UserWarning: Default grid_sample and affine_grid behavior has changed to align_corners=False since 1.3.0. Please specify align_corners=True if the old behavior is desired. See the documentation of grid_sample for details.
warnings.warn(
0%| | 0/50 [00:00<?, ?it/s]Continue DDIM with i = 2, t = 941, latent = torch.Size([8, 4, 64, 64]), device = cuda:0, type = torch.float16
96%|███████████████████████████████████████████████████████████████████████████████▋ | 48/50 [00:14<00:00, 3.27it/s]
Processing chunk 2 / 2
t0 = 881 t1 = 941
0%| | 0/50 [00:00<?, ?it/s]Continue DDIM with i = 0, t = 981, latent = torch.Size([1, 4, 64, 64]), device = cuda:0, type = torch.float16
latent t1 found at i=1, t = 961
8%|██████▋ | 4/50 [00:00<00:04, 10.09it/s]latent t0 found at i = 4, t = 901
100%|███████████████████████████████████████████████████████████████████████████████████| 50/50 [00:04<00:00, 10.10it/s]
0%| | 0/50 [00:00<?, ?it/s]Continue DDIM with i = 2, t = 941, latent = torch.Size([2, 4, 64, 64]), device = cuda:0, type = torch.float16
96%|███████████████████████████████████████████████████████████████████████████████▋ | 48/50 [00:06<00:00, 6.89it/s]
Traceback (most recent call last):
File "/home/hanli/anaconda3/envs/t2vzero/lib/python3.9/site-packages/PIL/Image.py", line 3231, in open
fp.seek(0)
AttributeError: 'str' object has no attribute 'seek'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/hanli/han/Text2Video-Zero/test.py", line 10, in
model.process_text2video(prompt, fps = fps, path = out_path, **params)
File "/home/hanli/han/Text2Video-Zero/model.py", line 495, in process_text2video
return utils.create_video(result, fps, path=path, watermark=gradio_utils.logo_name_to_path(watermark))
File "/home/hanli/han/Text2Video-Zero/utils.py", line 109, in create_video
x = add_watermark(x, watermark)
File "/home/hanli/han/Text2Video-Zero/utils.py", line 29, in add_watermark
watermark = Image.open(watermark_path)
File "/home/hanli/anaconda3/envs/t2vzero/lib/python3.9/site-packages/PIL/Image.py", line 3233, in open
fp = io.BytesIO(fp.read())
AttributeError: 'str' object has no attribute 'read'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions