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

torch.jit.frontend.UnsupportedNodeError: JoinedStr aren't supported #35

Open
YanADingggg opened this issue Nov 14, 2021 · 1 comment
Open

Comments

@YanADingggg
Copy link

I tried to run this program under the environment and torch specified by the author, but this error occurred. Could you please help me check it? Thank you very much

Traceback (most recent call last):
File "train.py", line 10, in
import model.model as module_arch
File "/home/cas/桌面/jack/EESRGAN-master/model/model.py", line 7, in
import kornia
File "/home/cas/anaconda3/envs/deep-learning/lib/python3.7/site-packages/kornia/init.py", line 13, in
from kornia import augmentation, color, contrib, enhance, feature, filters, geometry, jit, losses, morphology, utils
File "/home/cas/anaconda3/envs/deep-learning/lib/python3.7/site-packages/kornia/jit/init.py", line 7, in
grayscale_to_rgb = torch.jit.script(K.color.grayscale_to_rgb)
File "/home/cas/anaconda3/envs/deep-learning/lib/python3.7/site-packages/torch/jit/init.py", line 823, in script
ast = get_jit_def(obj)
File "/home/cas/anaconda3/envs/deep-learning/lib/python3.7/site-packages/torch/jit/frontend.py", line 158, in get_jit_def
return build_def(ctx, py_ast.body[0], type_line, self_name)
File "/home/cas/anaconda3/envs/deep-learning/lib/python3.7/site-packages/torch/jit/frontend.py", line 198, in build_def
build_stmts(ctx, body))
File "/home/cas/anaconda3/envs/deep-learning/lib/python3.7/site-packages/torch/jit/frontend.py", line 122, in build_stmts
stmts = [build_stmt(ctx, s) for s in stmts]
File "/home/cas/anaconda3/envs/deep-learning/lib/python3.7/site-packages/torch/jit/frontend.py", line 122, in
stmts = [build_stmt(ctx, s) for s in stmts]
File "/home/cas/anaconda3/envs/deep-learning/lib/python3.7/site-packages/torch/jit/frontend.py", line 174, in call
return method(ctx, node)
File "/home/cas/anaconda3/envs/deep-learning/lib/python3.7/site-packages/torch/jit/frontend.py", line 332, in build_If
build_stmts(ctx, stmt.body),
File "/home/cas/anaconda3/envs/deep-learning/lib/python3.7/site-packages/torch/jit/frontend.py", line 122, in build_stmts
stmts = [build_stmt(ctx, s) for s in stmts]
File "/home/cas/anaconda3/envs/deep-learning/lib/python3.7/site-packages/torch/jit/frontend.py", line 122, in
stmts = [build_stmt(ctx, s) for s in stmts]
File "/home/cas/anaconda3/envs/deep-learning/lib/python3.7/site-packages/torch/jit/frontend.py", line 174, in call
return method(ctx, node)
File "/home/cas/anaconda3/envs/deep-learning/lib/python3.7/site-packages/torch/jit/frontend.py", line 288, in build_Raise
expr = build_expr(ctx, stmt.exc)
File "/home/cas/anaconda3/envs/deep-learning/lib/python3.7/site-packages/torch/jit/frontend.py", line 174, in call
return method(ctx, node)
File "/home/cas/anaconda3/envs/deep-learning/lib/python3.7/site-packages/torch/jit/frontend.py", line 405, in build_Call
args = [build_expr(ctx, py_arg) for py_arg in expr.args]
File "/home/cas/anaconda3/envs/deep-learning/lib/python3.7/site-packages/torch/jit/frontend.py", line 405, in
args = [build_expr(ctx, py_arg) for py_arg in expr.args]
File "/home/cas/anaconda3/envs/deep-learning/lib/python3.7/site-packages/torch/jit/frontend.py", line 173, in call
raise UnsupportedNodeError(ctx, node)
torch.jit.frontend.UnsupportedNodeError: JoinedStr aren't supported
image: grayscale image to be converted to RGB with shape :math:(*,1,H,W).
Returns:
RGB version of the image with shape :math:(*,3,H,W).

Example:
    >>> input = torch.randn(2, 1, 4, 5)
    >>> gray = grayscale_to_rgb(input) # 2x3x4x5
"""
if not isinstance(image, torch.Tensor):
    raise TypeError(f"Input type is not a torch.Tensor. " f"Got {type(image)}")
                    ~ <--- HERE
if image.dim() < 3 or image.size(-3) != 1:
    raise ValueError(f"Input size must have a shape of (*, 1, H, W). " f"Got {image.shape}.")
rgb: torch.Tensor = torch.cat([image, image, image], dim=-3)
image_is_float: bool = torch.is_floating_point(image)
if not image_is_float:
    warnings.warn(f"Input image is not of float dtype. Got {image.dtype}")
return rgb
@TriBall3
Copy link

I met the same problem with you , did you solve this?

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

2 participants