Skip to content

Conversation

@Pikamander2
Copy link

Fix TypeError in Python 3 (can only concatenate str (not "numpy.float64") to str)

Fix TypeError in Python 3 (can only concatenate str (not "numpy.float64") to str)
@Pikamander2
Copy link
Author

I was trying out ImageAI for the first time and noticed that one of the examples throws a TypeError when you try to run it.

The eachProbability variable needs to be cast into a string before concatenating it, so I wrapped a call to str() around it.

I also cast the eachPrediction variable to a string just to be safe, although that may not be necessary.

@codecov
Copy link

codecov bot commented Oct 5, 2020

Codecov Report

Merging #590 into master will decrease coverage by 38.17%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           master     #590       +/-   ##
===========================================
- Coverage   48.83%   10.66%   -38.18%     
===========================================
  Files          63       24       -39     
  Lines        5856     3450     -2406     
===========================================
- Hits         2860      368     -2492     
- Misses       2996     3082       +86     

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

Successfully merging this pull request may close these issues.

1 participant