Repository navigation
Scene Segmentation with SynF #509
Description
Activity
@amyvanee did you try fitting proglearn for one task only? I would not try it with other people's code. Please try to train it on only one task using add_task first. Let's not use parallel for now.
@amyvanee Which version of
proglearnare you using?@PSSF23 Sorry about that, I am using Proglearn 0.0.5
@jdey4 I tried going to the basics more and initializing a LifelongClassification Forest, but I got an error.
% Declare the progressive learner model (L2F) learner = LifelongClassificationForest() % add the task learner.add_task( flat_x, flat_y, task_id=0 )
And the output,
TypeError Traceback (most recent call last) TypeError: only size-1 arrays can be converted to Python scalars The above exception was the direct cause of the following exception: ValueError Traceback (most recent call last) <ipython-input-18-74e8ef13550e> in <module> 3 4 # add the task ----> 5 learner.add_task( 6 flat_x, 7 flat_y, ~\AppData\Local\Programs\Python\Python39\lib\site-packages\proglearn-0.0.5-py3.9.egg\proglearn\forest.py in add_task(self, X, y, task_id, n_estimators, tree_construction_proportion, kappa, max_depth) 122 max_depth = self.default_max_depth 123 --> 124 X, y = check_X_y(X, y) 125 return self.pl_.add_task( 126 X, ~\AppData\Local\Programs\Python\Python39\lib\site-packages\sklearn\utils\validation.py in check_X_y(X, y, accept_sparse, accept_large_sparse, dtype, order, copy, force_all_finite, ensure_2d, allow_nd, multi_output, ensure_min_samples, ensure_min_features, y_numeric, estimator) 954 raise ValueError("y cannot be None") 955 --> 956 X = check_array( 957 X, 958 accept_sparse=accept_sparse, ~\AppData\Local\Programs\Python\Python39\lib\site-packages\sklearn\utils\validation.py in check_array(array, accept_sparse, accept_large_sparse, dtype, order, copy, force_all_finite, ensure_2d, allow_nd, ensure_min_samples, ensure_min_features, estimator) 736 array = array.astype(dtype, casting="unsafe", copy=False) 737 else: --> 738 array = np.asarray(array, order=order, dtype=dtype) 739 except ComplexWarning as complex_warning: 740 raise ValueError( ~\AppData\Local\Programs\Python\Python39\lib\site-packages\numpy\core\_asarray.py in asarray(a, dtype, order) 81 82 """ ---> 83 return array(a, dtype, copy=False, order=order) 84 85 ValueError: setting an array element with a sequence.
I double checked, and below are shapes,
- flat_x.shape = (64,)
- flat_y.shape = (64,)
- flat_x[0].shape = (10890000,)
- flat_y[0].shape = (9000000,)
- data_x[0].shape = (2200, 1650, 3)
- data_y[0].shape = (2000, 1500, 3)
If I try putting in any of the other data, I get an error that the input should be 2D.
Also, it is weird that the shape of data_y[0] is not the same as for data_x[0]?
Thank you for your help!
@amyvanee always use the latest version, which is
0.0.6now. And what aredata_x&flat_x& ... ? We have no idea what they are, but theyseems too large. What are the labels of these images?-
Thank you! I tried updating to Proglearn 0.0.6, using
pip install proglearn --upgrade
but I got an error.
error: Could not find module 'hdf5.dll' (or one of its dependencies). Try using the full path with constructor syntax. Loading library to get version: hdf5.dll -
The images are from the ADE20K consistency set
-
There are 64 images, each 2D with RGB so the image arrays are 3D. X is the original image, and Y is the image where each pixel is annotated by the object it is. (I am not sure why, but the array dimensions do not match up between X and Y)
-
data_x and data_y are the original images and the annotated image. flat_x and flat_y are the flattened version of these images, since we thought flattening them to be 1D would help with insertion into proglearn.
Thank you for your help!
-
- changed the title
[-]Scene Segmentation with Random Forest[/-][+]Scene Segmentation with Odif[/+]on Nov 7, 2021 - The error is unrelated to
proglearn. I have never seen it before. - Your fitting process doesn't make sense. Based on your descriptions, each
yimage is different so there's no valid classification.
- The error is unrelated to
BTW are you working on #39 ? Why didn't you comment on it?
- Thank you, I will try seeing if I can fix it another way!
- Yes that was my concern since I know proglearn takes in the true labels as one label per image (so a 2D image where the output is, for example, "dog") -- would I need to make modifications to the proglearn code to do this? I know scikit actually has this feature with random forests, and it seems to work. I still need to quantify how accurate it is.
- Yes, I am working on issue implement scene segmentation #39! Sorry I should have commented there.
@amyvanee No problem. As the example in your link,
sklearnRF must rely onskimageto process the images. You can definitely follow it and try it onproglearn. Odif (LifelongClassificationForest) would replace theRandomForestClassifierin that example.Comment on #39 so it could be assigned to you. Are there other students sharing the issue?
@PSSF23 Thank you, I will try that! Yes, I am working with Narayani Wagle (@nhwagle) and Kevin Rao (@KhelmholtzR) We made a separate GitHub repo with some of our progress
Reacted by Haoyin Xuamyvanee commented
on Nov 10, 2021 on Nov 10, 2021 · Hidden as resolvedAuthorshow commentMore actions- changed the title
[-]Scene Segmentation with Odif[/-][+]Scene Segmentation with SynF[/+]on Jan 24, 2022
#39 My issue is about adjusting Proglearn so we can do scene segmentation after flattening the images.
Reproducing code example:
Error message
Version information