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: masked_fill_ only supports boolean masks, but got mask with dtype unsigned char #1

Open
cool-RR opened this issue Jul 15, 2024 · 0 comments

Comments

@cool-RR
Copy link

cool-RR commented Jul 15, 2024

When running the Colab:

old, tau=1.0, lambda=1.0
bs 64
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
[<ipython-input-9-168f548fe4ca>](https://localhost:8080/#) in <cell line: 3>()
      1 # Check the correlation of different estimators with the true derivatives as a function of batch size
      2 
----> 3 run_corr_exp()
      4 plot_corr_exp()

2 frames
[<ipython-input-2-9f6565e0a71e>](https://localhost:8080/#) in make_objective(batch_data, v_fn, tau, dice_lambda, use_dice, gamma_weighted)
     22         batch_r, batch_dones, batch_mask, ep_returns) = batch_data
     23     empty_mask = (1 - batch_mask[:,:-1]).type(torch.ByteTensor)
---> 24     batch_pi_taken[empty_mask] = 1.0
     25     log_pi = torch.log(batch_pi_taken)
     26     batch_values = v_fn(batch_states).detach()

RuntimeError: masked_fill_ only supports boolean masks, but got mask with dtype unsigned char

Maybe you've used an older version of some dependency. If so, I suggest you'd pin the colab to the versions you used.

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

1 participant