AttributeError: 'int' object has no attribute 'astype'
See original GitHub issueIn file “./faster-rcnn.pytorch-master/lib/roi_data_layer/roibatchLoader.py” line:54, self.ratio_list_batch[left_idx:(right_idx+1)] = torch.tensor(target_ratio.astype(np.float64)) # trainset ratio list ,each batch is same number
I met the error AttributeError: 'int' object has no attribute 'astype'
. My sovle method is remove ‘astype(np.float64)’. Although there is no error, is it right ? Has it effect on experients result?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
AttributeError: 'int' object has no attribute 'astype' #613 - GitHub
it worked. now i am getting : File "/content/drive/My Drive/fasterrcnn18nov/faster-rcnn.pytorch/lib/model/rpn/proposal_target_layer_cascade.py", ...
Read more >'float' object has no attribute 'astype' - Stack Overflow
I am trying to find median values in a column of the dataframe. The median value that I am getting is float but...
Read more >AttributeError: 'list' object has no attribute 'astype' | bobbyhadz
The Python "AttributeError: 'list' object has no attribute 'astype'" occurs when we try to call the astype() method on a list. To solve...
Read more >Error converting to string using astype(str) - DQ Courses
Integers do not have the method .astype(str), but you can apply the function str() which is designed to take an integer as an...
Read more >How to convert float into int in pandas? - Intellipaat Community
The code I am using for converting the float into int is as follows: users.age.mean(). ... AttributeError: 'float' object has no attribute ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
/lib/roi_data_layer/roibatchLoader.py line 52, target_ratio = 1 change to: target_ratio = np.array(1)
@wangken1994 Exactly the same problem as yours.
I downgrade Pytorch from version 0.4.0 to 0.3.0 and got the error. If I do not downgrade it, I will encounter a FileNotFoundError. Related comments: https://github.com/pytorch/pytorch/issues/6932#issuecomment-557059493, https://github.com/jwyang/faster-rcnn.pytorch/issues/199#issuecomment-557062508, https://github.com/jwyang/faster-rcnn.pytorch/issues/421#issuecomment-557061870.
How did you solve it in the end?