New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

itkPyBufferTest #253

Open
hjmjohnson opened this Issue Dec 1, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@hjmjohnson
Member

hjmjohnson commented Dec 1, 2018

Description

263: Test command: /localscratch/Users/johnsonhj/ITK-bld/bin/itkTestDriver "--add-before-env" "PYTHONPATH" "/localscratch/Users/johnsonhj/ITK-bld/Wrapping/Generators/Python/Release" "--add-before-env" "PYTHONPATH" "/localscratch/Users/johnsonhj/ITK-bld/Wrapping/Generators/Python" "--add-before-env" "PYTHONPATH" "/localscratch/Users/johnsonhj/ITK-bld/lib/Release" "--add-before-env" "PYTHONPATH" "/localscratch/Users/johnsonhj/ITK-bld/lib" "--add-before-libpath" "/localscratch/Users/johnsonhj/ITK-bld/lib/Release" "--add-before-libpath" "/localscratch/Users/johnsonhj/ITK-bld/lib" "--add-before-libpath" "/localscratch/Users/johnsonhj/ITK-bld/bin/Release" "--add-before-libpath" "/localscratch/Users/johnsonhj/ITK-bld/bin" "/Users/johnsonhj/intel/intelpython3/bin/python" "/localscratch/Users/johnsonhj/ITK/Modules/Bridge/NumPy/test/itkPyBufferTest.py"
263: Test timeout computed to be: 600
263: test_NumPyBridge_FortranOrder (main.TestNumpyITKMemoryviewInterface)
263: Try to convert an ITK image to / from a NumPy array with Fortran order ... ok
263: test_NumPyBridge_itkRGBAImage (main.TestNumpyITKMemoryviewInterface)
263: Try to convert an RGBA ITK image to NumPy array view ... ok
263: test_NumPyBridge_itkRGBImage (main.TestNumpyITKMemoryviewInterface)
263: Try to convert an RGB ITK image to NumPy array view ... ok
263: test_NumPyBridge_itkScalarImage (main.TestNumpyITKMemoryviewInterface)
263: Try to convert all pixel types to NumPy array view ... ok
263: test_NumPyBridge_itkScalarImageDeepCopy (main.TestNumpyITKMemoryviewInterface)
263: Try to convert all pixel types to NumPy array view with a deep copy ... ok
263: test_NumPyBridge_itkVectorImage (main.TestNumpyITKMemoryviewInterface)
263: Try to convert all pixel types to NumPy array view ... ERROR
263: test_NumPyBridge_itkVectorPixelImage (main.TestNumpyITKMemoryviewInterface)
263: Try to convert an ITK image with vector pixels to NumPy array view ... ok
263:
263: ======================================================================
263: ERROR: test_NumPyBridge_itkVectorImage (main.TestNumpyITKMemoryviewInterface)
263: Try to convert all pixel types to NumPy array view
263: ----------------------------------------------------------------------
263: RuntimeError: Mismatch between the number of components in the image and the fastest running dimension of the Numpy array .
263:
263: During handling of the above exception, another exception occurred:
263:
263: Traceback (most recent call last):
263: File "/localscratch/Users/johnsonhj/ITK/Modules/Bridge/NumPy/test/itkPyBufferTest.py", line 105, in test_NumPyBridge_itkVectorImage
263: convertedvectorImage = itk.PyBuffer[VectorImageType].GetImageViewFromArray(vectorndarr, is_vector=True)
263: File "/localscratch/Users/johnsonhj/ITK-bld/lib/itkPyBufferPython.py", line 12140, in GetImageViewFromArray
263: imgview = itkPyBufferVIUC3._GetImageViewFromArray( ndarr, ndarr.shape[-2::-1], ndarr.shape[-1] )
263: File "/localscratch/Users/johnsonhj/ITK-bld/lib/itkPyBufferPython.py", line 12020, in _GetImageViewFromArray
263: return _itkPyBufferPython.itkPyBufferVIUC3__GetImageViewFromArray(arr, shape, numOfComponent)
263: SystemError: returned a result with an error set
263:
263: ----------------------------------------------------------------------
263: Ran 7 tests in 3.916s
263:
263: FAILED (errors=1)
263: swig/python detected a memory leak of type 'itk::SmartPointer< itk::Image< itk::VariableLengthVector< unsigned char >,3 > > *', no destructor found.
263: itkTestDriver: Process exited with return value: 1
1/1 Test #263: itkPyBufferTest ..................***Failed 5.57 sec

0% tests passed, 1 tests failed out of 1

Label Time Summary:
ITKBridgeNumPy = 5.57 sec*proc (1 test)

Steps to Reproduce

  1. Build wiht all python datatypes
  2. Run ctest -R itkPyBufferTest$

Expected behavior

No test failure

Actual behavior

test failure

Reproducibility

100% reproducable on linux

Versions

latest master branch

Environment

linux

@thewtex

This comment has been minimized.

Member

thewtex commented Dec 3, 2018

CC: @SimonRit

@SimonRit

This comment has been minimized.

SimonRit commented Dec 5, 2018

Thanks for the report. I'd be happy to look into it but I could not reproduce the problem on my linux box with these cmake options:

srit@russula:~/src/itk/lin64-PythonWrapping> grep ^ITK_WRAP CMakeCache.txt 
ITK_WRAP_CASTXML:BOOL=ON
ITK_WRAP_DOC:BOOL=OFF
ITK_WRAP_EXPLICIT:BOOL=OFF
ITK_WRAP_IMAGE_DIMS:STRING=2;3
ITK_WRAP_JAVA:BOOL=OFF
ITK_WRAP_PERL:BOOL=OFF
ITK_WRAP_PYTHON:BOOL=ON
ITK_WRAP_PYTHON_LEGACY:BOOL=ON
ITK_WRAP_RUBY:BOOL=OFF
ITK_WRAP_SWIGINTERFACE:BOOL=ON
ITK_WRAP_TCL:BOOL=OFF
ITK_WRAP_VECTOR_COMPONENTS:STRING=2;3;4
ITK_WRAP_complex_double:BOOL=ON
ITK_WRAP_complex_float:BOOL=ON
ITK_WRAP_covariant_vector_double:BOOL=ON
ITK_WRAP_covariant_vector_float:BOOL=ON
ITK_WRAP_double:BOOL=ON
ITK_WRAP_float:BOOL=ON
ITK_WRAP_rgb_unsigned_char:BOOL=ON
ITK_WRAP_rgb_unsigned_short:BOOL=ON
ITK_WRAP_rgba_unsigned_char:BOOL=ON
ITK_WRAP_rgba_unsigned_short:BOOL=ON
ITK_WRAP_signed_char:BOOL=ON
ITK_WRAP_signed_long:BOOL=OFF
ITK_WRAP_signed_long_long:BOOL=ON
ITK_WRAP_signed_short:BOOL=ON
ITK_WRAP_unsigned_char:BOOL=ON
ITK_WRAP_unsigned_long:BOOL=OFF
ITK_WRAP_unsigned_long_long:BOOL=ON
ITK_WRAP_unsigned_short:BOOL=ON
ITK_WRAP_vector_double:BOOL=ON
ITK_WRAP_vector_float:BOOL=ON
ITK_WRAPPING:INTERNAL=ON
ITK_WRAP_CASTXML-ADVANCED:INTERNAL=1
ITK_WRAP_CASTXML_SOURCE_DIR:INTERNAL=/home/srit/src/itk/itk/Wrapping/Generators/CastXML
ITK_WRAP_DOC-ADVANCED:INTERNAL=1
ITK_WRAP_EXPLICIT-ADVANCED:INTERNAL=1
ITK_WRAP_JAVA-ADVANCED:INTERNAL=1
ITK_WRAP_PERL-ADVANCED:INTERNAL=1
ITK_WRAP_PYTHON_BINARY_DIR:INTERNAL=/home/srit/src/itk/lin64-PythonWrapping/Wrapping/Generators/Python
ITK_WRAP_PYTHON_SOURCE_DIR:INTERNAL=/home/srit/src/itk/itk/Wrapping/Generators/Python
ITK_WRAP_RUBY-ADVANCED:INTERNAL=1
ITK_WRAP_SWIGINTERFACE-ADVANCED:INTERNAL=1
ITK_WRAP_SWIGINTERFACE_BINARY_DIR:INTERNAL=/home/srit/src/itk/lin64-PythonWrapping/Wrapping/Generators/SwigInterface
ITK_WRAP_SWIGINTERFACE_SOURCE_DIR:INTERNAL=/home/srit/src/itk/itk/Wrapping/Generators/SwigInterface
ITK_WRAP_TCL-ADVANCED:INTERNAL=1
ITK_WRAP_complex_double-MODIFIED:INTERNAL=ON
ITK_WRAP_covariant_vector_double-MODIFIED:INTERNAL=ON
ITK_WRAP_double-MODIFIED:INTERNAL=ON
ITK_WRAP_rgb_unsigned_short-MODIFIED:INTERNAL=ON
ITK_WRAP_rgba_unsigned_short-MODIFIED:INTERNAL=ON
ITK_WRAP_signed_char-MODIFIED:INTERNAL=ON
ITK_WRAP_signed_long-ADVANCED:INTERNAL=1
ITK_WRAP_signed_long_long-MODIFIED:INTERNAL=ON
ITK_WRAP_unsigned_long-ADVANCED:INTERNAL=1
ITK_WRAP_unsigned_long_long-MODIFIED:INTERNAL=ON
ITK_WRAP_unsigned_short-MODIFIED:INTERNAL=ON
ITK_WRAP_vector_double-MODIFIED:INTERNAL=ON

Do you see an option that differs? Thanks,
Simon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment