DLC_ROI_tool icon indicating copy to clipboard operation
DLC_ROI_tool copied to clipboard

TypeError: Cannot do inplace boolean setting on mixed-types with a non np.nan value

Open saulobritto opened this issue 5 years ago • 8 comments

Hi,

I'm usign this tool to predict ROI in zebrafish videos. I'm analysing about 66 videos. In some of them, I got this error when Load the DLC File. Do you have any idea what is going on? Am I doing something wrong?

################## test1920 1920 top_left_X 0 im_width 1920 1920 top_left_X 0 im_width 1920 1920 Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\User\anaconda3\envs\ROI_ENV\lib\tkinter_init_.py", line 1883, in call return self.func(*args) File "C:\Windows\System32\DLC_ROI_tool\MousePositionTracker.py", line 194, in bodyparts_to_ROI My_ROI_df[truth_array]=ROI[1]['ROI'] File "C:\Users\User\anaconda3\envs\ROI_ENV\lib\site-packages\pandas\core\frame.py", line 3482, in setitem self._setitem_frame(key, value) File "C:\Users\User\anaconda3\envs\ROI_ENV\lib\site-packages\pandas\core\frame.py", line 3528, in _setitem_frame self._check_inplace_setting(value) File "C:\Users\User\anaconda3\envs\ROI_ENV\lib\site-packages\pandas\core\generic.py", line 5304, in _check_inplace_setting raise TypeError( TypeError: Cannot do inplace boolean setting on mixed-types with a non np.nan value ###################

Thank you in advance for your support.

saulobritto avatar Aug 10 '20 17:08 saulobritto

hmm interesting ill look into this now.

PolarBean avatar Aug 13 '20 12:08 PolarBean

Can you please send me the DLC file that is causing this error so i can replicate and fix?

PolarBean avatar Aug 13 '20 12:08 PolarBean

Hi there, I am having this same error. I've used the ROI tool successfully in the past but I am getting this error now when trying to load the DLC file associated with my video. Let me know if there has been any headway on this issue. My email is [email protected], thank you!

natalier11 avatar May 07 '21 22:05 natalier11

Hello! I am also having the same error when using the .h5 file. If it helps, when using the .csv file I get this error:

Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\idavalik\AppData\Local\Continuum\anaconda3\envs\DLC_ROI\lib\site-packages\pandas\core\internals\managers.py", line 1675, in create_block_manager_from_blocks make_block( File "C:\Users\idavalik\AppData\Local\Continuum\anaconda3\envs\DLC_ROI\lib\site-packages\pandas\core\internals\blocks.py", line 2742, in make_block return klass(values, ndim=ndim, placement=placement) File "C:\Users\idavalik\AppData\Local\Continuum\anaconda3\envs\DLC_ROI\lib\site-packages\pandas\core\internals\blocks.py", line 142, in init raise ValueError( ValueError: Wrong number of items passed 9, placement implies 10

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\idavalik\AppData\Local\Continuum\anaconda3\envs\DLC_ROI\lib\tkinter_init_.py", line 1883, in call return self.func(*args) File "C:\Users\idavalik\DLC_ROI_tool\MousePositionTracker.py", line 129, in bodyparts_to_ROI My_ROI_df=pd.DataFrame(np.zeros(X_data.shape),columns=mylist) File "C:\Users\idavalik\AppData\Local\Continuum\anaconda3\envs\DLC_ROI\lib\site-packages\pandas\core\frame.py", line 558, in init mgr = init_ndarray(data, index, columns, dtype=dtype, copy=copy) File "C:\Users\idavalik\AppData\Local\Continuum\anaconda3\envs\DLC_ROI\lib\site-packages\pandas\core\internals\construction.py", line 238, in init_ndarray return create_block_manager_from_blocks(block_values, [columns, index]) File "C:\Users\idavalik\AppData\Local\Continuum\anaconda3\envs\DLC_ROI\lib\site-packages\pandas\core\internals\managers.py", line 1687, in create_block_manager_from_blocks raise construction_error(tot_items, blocks[0].shape[1:], axes, e) ValueError: Shape of passed values is (54787, 9), indices imply (54787, 10)

Please let me know if there has been an update to this issue! Either here or on my e-mail: [email protected]. Thank you for your time!

Idavr avatar Jun 10 '21 17:06 Idavr

I am also having this same error... If anyone has found a solution, I would really appreciate some advice at [email protected] :)

sannatitus avatar Oct 25 '22 10:10 sannatitus

I have same error... (before I need changele short, because this erro: C:\Users\anaca\anaconda3\envs\ROI_ENV\lib\site-packages\pandas\core\frame.py:7134: FutureWarning: Sorting because non-concatenation axis is not aligned. A future version of pandas will change to not sort by default.

To accept the future behavior, pass 'sort=False'.

To retain the current behavior and silence the warning, pass 'sort=True'.

after this erro is show... Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\anaca\anaconda3\envs\ROI_ENV\lib\tkinter_init_.py", line 1883, in call return self.func(*args) File "C:\Users\anaca\Downloads\programas_de_rastreio\DLC\DLC_ROI_tool-master\MousePositionTracker.py", line 132, in bodyparts_to_ROI My_ROI_df[truth_array]=ROI[1]['ROI'] File "C:\Users\anaca\anaconda3\envs\ROI_ENV\lib\site-packages\pandas\core\frame.py", line 3482, in setitem self._setitem_frame(key, value) File "C:\Users\anaca\anaconda3\envs\ROI_ENV\lib\site-packages\pandas\core\frame.py", line 3528, in _setitem_frame self._check_inplace_setting(value) File "C:\Users\anaca\anaconda3\envs\ROI_ENV\lib\site-packages\pandas\core\generic.py", line 5304, in _check_inplace_setting raise TypeError( TypeError: Cannot do inplace boolean setting on mixed-types with a non np.nan value

anacastropsico avatar Nov 11 '22 21:11 anacastropsico

Make sure you're using the version of pandas specified in the readme

PolarBean avatar Nov 12 '22 04:11 PolarBean