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.

AttributeError : Constant object has no attribute ‘kind’

See original GitHub issue
  • I used covid protein ‘nsp2.pdb’ file.(In this “ structure_utils_tests.ipynb” test file)
  • In this part occured error
N_mask  = torch.tensor( prot_traj.topology.select("name == N and backbone") ).unsqueeze(0)
CA_mask = torch.tensor( prot_traj.topology.select("name == CA and backbone") ).unsqueeze(0) 
C_mask  = torch.tensor( prot_traj.topology.select("name == C and backbone")  ).unsqueeze(0)
CA_mask.shape, N_mask.shape, C_mask.shape
  • Error Log
   549             self.write("...")
    550         else:
--> 551             if t.kind == "u":
    552                 self.write("u")
    553             self._write_constant(t.value)

AttributeError: 'Constant' object has no attribute 'kind'
  • Please give me solutions.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
hypnopumpcommented, Mar 15, 2021

Please, try the fix suggested here: https://github.com/simonpercivall/astunparse/issues/43 regarding the instruction to comment the if statement

0reactions
Planet-KIMcommented, Mar 15, 2021
  • Now i used "madtraj == 1.9.4 " (Now i try 1.9.1 version. But It’s fail too)
  • What version using on this project?
Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: 'module' object has no attribute 'constant'
I have a pervasive error when importing tensorflow import tensorflow as tf AttributeError: 'module' object has no attribute 'constant' help is welcome,.
Read more >
Why am I getting AttributeError: Object has no attribute? [closed]
Your indentation is goofed, and you've mixed tabs and spaces. Run the script with python -tt to verify.
Read more >
Create onnx graph throws AttributeError: 'Variable' object has ...
I successfully exported the TensorFlow model with float_image_tensor as the input type. However, when I try to create the onnx graph using ...
Read more >
inspect — Inspect live objects — Python 3.11.1 documentation
If the parameter has no annotation, this attribute is set to Parameter.empty . kind¶. Describes how argument values are bound to the parameter....
Read more >
Python's property(): Add Managed Attributes to Your Classes
AttributeError : 'Circle' object has no attribute '_radius' >>> help(circle) Help on Circle in module __main__ object: class Circle(builtins.object) .
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