Skip to content

Commit 27169fd

Browse files
authored
Add float/double common problem to README
Fixes lucasb-eyer#49 lucasb-eyer#52
1 parent 3c020a6 commit 27169fd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,13 @@ Common Problems
244244

245245
If while importing pydensecrf you get an error about some undefined symbols (for example `.../pydensecrf/densecrf.so: undefined symbol: _ZTINSt8ios_base7failureB5cxx11E`), you most likely are inadvertently mixing different compilers or toolchains. Try to see what's going on using tools like `ldd`. If you're using Anaconda, [running `conda install libgcc` might be a solution](https://github.com/lucasb-eyer/pydensecrf/issues/28).
246246

247+
ValueError: Buffer dtype mismatch, expected 'float' but got 'double'
248+
--------------------------------------------------------------------
249+
250+
This is a pretty [co](https://github.com/lucasb-eyer/pydensecrf/issues/52)mm[on](https://github.com/lucasb-eyer/pydensecrf/issues/49) user error.
251+
It means exactly what it says: you are passing a `double` but it wants a `float`.
252+
Solve it by, for example, calling `d.setUnaryEnergy(U.astype(np.float32))` instead of just `d.setUnaryEnergy(U)`, or using `float32` in your code in the first place.
253+
247254
Maintaining
248255
===========
249256

0 commit comments

Comments
 (0)