-
Notifications
You must be signed in to change notification settings - Fork 21
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
Runtime Error #7
Comments
您好,请问这个问题解决了吗? |
Hi, thanks for your interesting work. When i run the anime to photography task: python translation.py --base configs/creativity/anime_photography_256.yaml -t --gpus0, i receive the following error:
Traceback (most recent call last):
File "translation.py", line 522, in
trainer . fit(model, data)
File " /home /projects /miniconda3/ envs/net2net/lib/python3.7/site- packages/pytorch lightning/ trainer /states.py", line 48, in wrapped_ fn
result = fn(self , *args, **kwargs
File " /home/projects/miniconda3/envs /net2net/lib/python3.7/site-packages/pytorch_ lightning/ trainer/trainer .py", line 1058, in fit
results = self . accelerator_ backend. spawn_ ddp_ children( model )
File "/home/projects/miniconda3/envs /net2net/lib/python3 .7/site - packages /pytorch_ lightning/ accelerators/ddp_ backend.py", line 123, in spawn_ ddp_ childrenresults = self .ddp_ train(local_ rank, mp_ queue=None, model=model, is_ master=True )
File " /home / projects /miniconda3/envs /net2net/ lib/ python3.7/site- packages / pytorch_ lightning/ accelerators/ddp_ backend.py", line 224, in ddp_ train
results = self . trainer .run_ pretrain_ routine( model )
File " /home/projects/miniconda3/ envs /ne t2net/ lib/py thon3.7/site - packages/py torch_ lightning/trainer/trainer .py", line 1224, in run_ pretrain_ routineself._ run_ sanity check(ref_ model,model)
File " /home/projects/miniconda3/envs /net2net/lib/python3.7/site - packages/pytorch_ lightning/trainer/trainer .py", line 1257, in run_ sanity check
eval_ results = self._ evaluate(model, self .val_ dataloaders, max_ batches, False )
File " /home / projects /miniconda3 /envs /net2net/lib/python3.7/site- packages/ pytorch_ lightning/trainer /evaluation_ loop.py", line 369, in_ evaluate
self . on_ validation_ batch_ end( batch, batch_ idx, dataloader_ idx
File " /home /projects/miniconda3/envs /net2net/lib/py thon3.7/site packages/pytorch lightning/trainer/callback_ hook.py", line 156, in on_ validation_ batch_ endcallback. on validation batch end(self, self . getdell0batch, batch_ idx, dataloader idx)
File " /home /projects/net2net/translation.py", line 297, in on_ validation_ batch_ end
self.log_ img(pl_ module, batch, batch_ idx, split="val"
File " /home /projects /net2net/ translation.py", line 265, in log_ img
images = pl_ module. log_ images(batch, split=split)
File " /home /projects/miniconda3/envs /net2net/lib/python3. 7/site- packages/ torch/ autograd/grad_ mode.py", line 28, in decorate_ context
return func(*args, **kwargs)
File " /home /projects/net2net/net2net/models/flows/flow.py", line 157, in log_ images
log[" conditioning"] = log_ txt_ as_ img((w,h), xc)
File " /home /projects/ net2net /net2net/modules/util.py", line 18, in log_ txt_ as_ img
lines = "In" . join(xc[bi][start:start+nc] for start in range(0, len(xc[bi]), nc))
File " /home /projects /miniconda3/envs /net2nelib/python3.7/site-ackages/torch/_ tensor.py", line 589, in_ len__
raise TypeError("len() of a 0-d tensor "
TypeError: len() of a 0-d tensor
I don't know what causes this error. I would greatly appreciate it if you could help me find out the problem. Thanks for your time.
The text was updated successfully, but these errors were encountered: