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

RuntimeError: expected predicate to be bool, got torch.uint8 #50

Open
githubjixin opened this issue Aug 31, 2023 · 1 comment
Open

RuntimeError: expected predicate to be bool, got torch.uint8 #50

githubjixin opened this issue Aug 31, 2023 · 1 comment

Comments

@githubjixin
Copy link

您好作者,请教一下大佬,我在运行main.py时
遇到的这个uint-8的问题,整个程序都可以运行,这个对整体效果会有影响吗,请您帮忙看一下

[2023-08-31 10:45:35,911] torch._dynamo.convert_frame: [INFO] converting frame raised error, suppressing error
[2023-08-31 10:45:35,971] torch._dynamo.symbolic_convert: [INFO] Step 1: torchdynamo start tracing _compute_normalizer
[2023-08-31 10:45:35,999] torch._dynamo.convert_frame: [ERROR] WON'T CONVERT _compute_normalizer /Users/mac/opt/anaconda3/envs/py38/lib/python3.8/site-packages/torchcrf/init.py line 208
due to:
Traceback (most recent call last):
File "/Users/mac/opt/anaconda3/envs/py38/lib/python3.8/site-packages/torch/_prims_common/init.py", line 1563, in check
raise exc_type(s())
RuntimeError: expected predicate to be bool, got torch.uint8

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Users/mac/opt/anaconda3/envs/py38/lib/python3.8/site-packages/torch/_dynamo/utils.py", line 1206, in run_node
raise RuntimeError(
RuntimeError: Failed running call_function <built-in method where of type object at 0x12f69d850>(*(FakeTensor(FakeTensor(..., device='meta', size=(32, 1), dtype=torch.uint8), cpu), FakeTensor(FakeTensor(..., device='meta', size=(32, 105), grad_fn=), cpu), FakeTensor(FakeTensor(..., device='meta', size=(32, 105), grad_fn=), cpu)), **{}):
expected predicate to be bool, got torch.uint8
(scroll up for backtrace)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Users/mac/opt/anaconda3/envs/py38/lib/python3.8/site-packages/torch/_dynamo/utils.py", line 1173, in get_fake_value
raise TorchRuntimeError() from e
torch._dynamo.exc.TorchRuntimeError:

from user code:
File "/Users/mac/opt/anaconda3/envs/py38/lib/python3.8/site-packages/torchcrf/init.py", line 249, in _compute_normalizer
score = torch.where(mask[i].unsqueeze(1), next_score, score)

Set torch._dynamo.config.verbose=True for more information

@taishan1994
Copy link
Owner

没有报错导致程序中断就应该没啥影响。

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