question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error: no suitable constructor exists to convert from "c10::ScalarType" to "at::Type"

See original GitHub issue

I encounter this error when executing

python setup.py build develop

det3d/ops/sigmoid_focal_loss/src/sigmoid_focal_loss_cuda.cu(121): error: no suitable constructor exists to convert from “c10::ScalarType” to “at::Type”

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
muzi2045commented, Jan 8, 2020

If you are using pytorch 1.0, you will face this error(same as me). there is some api changed between torch 1.0 and 1.3 check this part in the sigmoid_focal_loss_cuda.cu file

/** pytorch 1.1+ **/
  // AT_DISPATCH_FLOATING_TYPES_AND_HALF(
  //     logits.scalar_type(), "SigmoidFocalLoss_forward", [&] {
  //       SigmoidFocalLossForward<scalar_t><<<grid, block>>>(
  //           losses_size, logits.contiguous().data<scalar_t>(),
  //           targets.contiguous().data<int64_t>(), num_classes, gamma, alpha,
  //           num_samples, losses.data<scalar_t>());
  //     });

  /** pytorch 1.0 **/
  AT_DISPATCH_FLOATING_TYPES_AND_HALF(
      logits.type(), "SigmoidFocalLoss_forward", [&] {
        SigmoidFocalLossForward<scalar_t><<<grid, block>>>(
            losses_size, logits.contiguous().data<scalar_t>(),
            targets.contiguous().data<int64_t>(), num_classes, gamma, alpha,
            num_samples, losses.data<scalar_t>());
      });
0reactions
cslxiaocommented, Jan 8, 2020

@muzi2045 Thanks. Updating torch solves this problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

C++ no suitable constructor exists to convert from
Here is our assignment operator and our standard overloaded constructor, but Visual studio gives us a weird error: Error 2 error LNK2019: ...
Read more >
error #415: no suitable constructor exists to convert from 'const...
IBM Rational Test RealTime 8.0.1 delivers an attolcc4 and atostart4 based on EDG 4.7 parser. USE_ATTOLCC4 must be set in the TDP basic...
Read more >
"no suitable constructor exists to convert from" error when i'm ...
I made LPFEED class and I declared pFeed by it. And it is the data of the m_FeedMap(cocos2d::Map Container).
Read more >
IntelliSense: no suitable constructor exists to convert from "std ...
The program should first prompt the user to input the data for each monkey, starting with "Sunday" for monkey #1, then monkeys #2...
Read more >
int2 i = 0; // error: no suitable constructor ? - CUDA ...
int2 i = 0; // error: no suitable constructor exists to convert from “int” to “uint2” (I can only guess that this is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found