TypeError: `pad_width` must be of integral type.
See original GitHub issueHello, thank you for your code.
When I try to run the train.py to do a demo, but I get a “TypeError: pad_width must be of integral type.”, and it points to the “Keras-FCN\utils\SegDataGenerator.py”, line 238, in next
x = np.lib.pad(x, ((pad_h / 2, pad_h - pad_h / 2), (pad_w / 2, pad_w - pad_w / 2), (0, 0)), ‘constant’, constant_values=0.)". I don’t know how to fix this problem, can you give me some suggestions?
Issue Analytics
- State:
- Created 6 years ago
- Comments:9
Top Results From Across the Web
TypeError: pad_width must be of integral type. #12852 - GitHub
np.pad() raises an exception when trying to pad multiple axes with before and after padding. Reproducing code example: import numpy as np a ......
Read more >How to pad arrays by a variable amount? - Stack Overflow
Unfortunately I am getting the error message: TypeError: pad_width must be of integral type. Edit: i changed pad_h to (max_h - p[0])//2 (and ......
Read more >numpy.pad — NumPy v1.25.dev0 Manual
(pad,) or int is a shortcut for before = after = pad width for all axes. ... value of the linear_ramp and that...
Read more >cupy.padding.pad — Chainer 1.24.0 documentation
[docs]def pad(array, pad_width, mode, **keywords): """Returns padded array. ... 'i': raise TypeError('pad_width must be of integral type.
Read more >numpy/lib/arraypad.py - Fossies
94 pad_width : sequence of tuple[int, int] 95 Pad width on both sides for each dimension ... 'i': 741 raise TypeError('`pad_width` must be...
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 Free
Top 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
@lxyhahaha you seem to be using Python 3 where
/does floating point division by default; you might want to change that to//which performs integral division.@anas-899 I solved it by following code: