Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timestep issue in svd #515

Open
bilalmashooq opened this issue May 27, 2024 · 2 comments
Open

timestep issue in svd #515

bilalmashooq opened this issue May 27, 2024 · 2 comments

Comments

@bilalmashooq
Copy link

(venv) PS C:\Users\Students\PycharmProjects\pythonProject> python examples/svd/image_to_video.py --mode=1 --SVD.config=examples/svd/configs/svd.yaml --SVD.checkpoint=checkpoints/svd-d19a808f.ckpt --SVD.num_frames=5 --SVD.fps=15 --image=download.jpeg --SVD.decode_chunk_size=1
flash attention is available.
Image size is not divisible by 64 (300x168). Resizing it to (256x128)!
Initialized embedder #0: FrozenOpenCLIPImagePredictionEmbedder with 683800065 params. Trainable: False
Initialized embedder #1: ConcatTimestepEmbedderND with 0 params. Trainable: False
Initialized embedder #2: ConcatTimestepEmbedderND with 0 params. Trainable: False
Initialized embedder #3: VideoPredictionEmbedderWithEncoder with 83653863 params. Trainable: False
Initialized embedder #4: ConcatTimestepEmbedderND with 0 params. Trainable: False
Loading model from C:\Users\Students\PycharmProjects\pythonProject\checkpoints/svd-d19a808f.ckpt
INFO:main:Starting video generation, this may take a while...
Traceback (most recent call last):
File "examples/svd/image_to_video.py", line 202, in
main(cfg)
File "examples/svd/image_to_video.py", line 181, in main
vid = pipeline(Tensor(image))
File "C:\Users\Students\PycharmProjects\pythonProject\venv\lib\site-packages\mindspore\nn\cell.py", line 705, in call
raise err
File "C:\Users\Students\PycharmProjects\pythonProject\venv\lib\site-packages\mindspore\nn\cell.py", line 701, in call
output = self._run_construct(args, kwargs)
File "C:\Users\Students\PycharmProjects\pythonProject\venv\lib\site-packages\mindspore\nn\cell.py", line 482, in _run_construct
output = self.construct(*cast_inputs, **kwargs)
File "examples/svd/image_to_video.py", line 135, in construct
samples_x = self.model.decode_first_stage(samples_z)
File "C:\Users\Students\PycharmProjects\pythonProject\examples/stable_diffusion_xl\gm\models\diffusion.py", line 139, in decode_first_stage
out = self.first_stage_model.decode(z)
File "C:\Users\Students\PycharmProjects\pythonProject\examples/stable_diffusion_xl\gm\models\autoencoder.py", line 100, in decode
x = self.decoder(z, **kwargs)
File "C:\Users\Students\PycharmProjects\pythonProject\venv\lib\site-packages\mindspore\nn\cell.py", line 705, in call
raise err
File "C:\Users\Students\PycharmProjects\pythonProject\venv\lib\site-packages\mindspore\nn\cell.py", line 701, in call
output = self._run_construct(args, kwargs)
File "C:\Users\Students\PycharmProjects\pythonProject\venv\lib\site-packages\mindspore\nn\cell.py", line 482, in _run_construct
output = self.construct(*cast_inputs, **kwargs)
File "C:\Users\Students\PycharmProjects\pythonProject\examples/stable_diffusion_xl\gm\modules\diffusionmodules\model.py", line 509, in construct
h = self.mid.block_1(h, temb, **kwargs)
File "C:\Users\Students\PycharmProjects\pythonProject\venv\lib\site-packages\mindspore\nn\cell.py", line 705, in call
raise err
File "C:\Users\Students\PycharmProjects\pythonProject\venv\lib\site-packages\mindspore\nn\cell.py", line 701, in call
output = self._run_construct(args, kwargs)
File "C:\Users\Students\PycharmProjects\pythonProject\venv\lib\site-packages\mindspore\nn\cell.py", line 482, in _run_construct
output = self.construct(*cast_inputs, **kwargs)
File "C:\Users\Students\PycharmProjects\pythonProject\examples\svd\modules\temporal_ae.py", line 69, in construct
x_spat = x.reshape(-1, timesteps, c, h, w).swapaxes(1, 2) # (b t) c h w -> b c t h w
File "C:\Users\Students\PycharmProjects\pythonProject\venv\lib\site-packages\mindspore\common\tensor.py", line 2043, in swapaxes
return tensor_operator_registry.get('swapaxes')(self, axis0, axis1)
File "C:\Users\Students\PycharmProjects\pythonProject\venv\lib\site-packages\mindspore\ops\function\array_func.py", line 7334, in swapaxes
axis0, axis1 = _check_swapaxes_axis((axis0, axis1), input.ndim)
return len(self.shape)
File "C:\Users\Students\PycharmProjects\pythonProject\venv\lib\site-packages\mindspore\common_stub_tensor.py", line 85, in shape
self.stub_shape = self.stub.get_shape()
TypeError: For primitive[Reshape], the input[shape] must be one of ['int', 'tuple', 'list'] with all Int elements, but got (-1, None, 512, 16, 32)


  • C++ Call Stack: (For framework developers)

mindspore\core\utils\check_convert_utils.cc:1204 mindspore::CheckAndConvertUtils::CheckIntOrTupleInt

I am unable to resolve this issue, can you tell me why this is happening,
using mindspore with cpu

@feesavage
Copy link

do u solve it ? i hve the same problem

@HaFred
Copy link
Collaborator

HaFred commented Oct 17, 2024

Did you check your input img situation? Make sure it's a valid img and the tensor read in correctly as described in the readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants