ivapylibs/puzzle_solver

Error in Hungarian

pv33 opened this issue · 1 comments

pv33 commented

Not sure what problem is.
Could it be a version issue?

pip3 list:

scikit-image              0.16.2               
scikit-learn                0.22.2.post1         
scipy                         1.3.3 

Either way, the code craps out. Any thoughts?

@yiyeChen Are you able to run the current rosbag runner by loading the two data files?

See output below:

pvela@tlacaelel:~/python/surveillance/Surveillance/deployment/ROS$ ./rosbag_runner.py --rosbag_name ~/data/superviseit/Testing/Yunzhi/Test_puzzle_solving/tangled_1_work.bag --puzzle_solver_SolBoard ~/data/superviseit/Testing/Yunzhi/Test_puzzle_solving/caliSolBoard.obj  
rosbag: no process found
================================================================================REQUIRED process [master] has died!                                                                                     
process has died [pid 52027, exit code -15, cmd rosmaster --core -p 11311 -w 3 __log:=/home/pvela/.ros/log/837af7c2-f97d-11ec-8f13-cd36f74d578f/master.log].                                            
log file: /home/pvela/.ros/log/837af7c2-f97d-11ec-8f13-cd36f74d578f/master*.log                     
Initiating shutdown!                                                                                
================================================================================                    
... logging to /home/pvela/.ros/log/f6f41ca8-f980-11ec-8f13-cd36f74d578f/roslaunch-tlacaelel-53944.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
[rosout-1] killing on exit
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://tlacaelel:36531/
ros_comm version 1.15.14


SUMMARY
========

PARAMETERS
 * /rosdistro: noetic
 * /rosversion: 1.15.14

NODES

auto-starting new master
process[master]: started with pid [53962]
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done
ROS_MASTER_URI=http://tlacaelel:11311/

setting /run_id to f6f41ca8-f980-11ec-8f13-cd36f74d578f
process[rosout-1]: started with pid [53972]
started core service [/rosout]
/home/pvela/python/ROSWrapper/ROSWrapper/publishers/Matrix_pub.py:25: SyntaxWarning: The publisher should be created with an explicit keyword argument 'queue_size'. Please see http://wiki.ros.org/rospy/Overview/Publishers%20and%20Subscribers for more information.
  self.publisher = rospy.Publisher(topic_name, Float64MultiArray)

 Calibrating the table geometry model...
Plane modeling result: 
 Got the fitted plane from the PCA. The three variance ratios are:[9.03208845e-01 9.66466202e-02 1.44534535e-04]
Table geometry model calibration done!

 Calibrating the hand segmentation model...
The hand segmentation model calibration done!

 Calibrating the background (table) model...
The background (table) model calibration done!
Initialization ready, waiting for the data...
Playback the rosbag recordings
[ INFO] [1656709289.981169361]: Opening /home/pvela/data/superviseit/Testing/Yunzhi/Test_puzzle_solving/tangled_1_work.bag
Waiting 2 seconds after advertising topics... done.

Hit space to toggle paused, or 's' to step.
Number of puzzle pieces registered in the solution board: 9
No new piece is detected.
Current calibrated pieces number: 0
The hand present?: False
Traceback (most recent call last):
  File "./rosbag_runner.py", line 648, in <module>
    listener.run_system()
  File "./rosbag_runner.py", line 433, in run_system
    plan = self.puzzleSolver.process(postImg, visibleMask, hTracker_BEV)
  File "/home/pvela/python/puzzle_solver/puzzle/runner.py", line 253, in process
    plan = self.thePlanner.process(theArrangeMea, rLoc_hand=hTracker_BEV, visibleMask=visibleMask,
  File "/home/pvela/python/puzzle_solver/puzzle/simulator/planner.py", line 489, in process
    plan = self.adapt(meaBoard, rLoc_hand=rLoc_hand, visibleMask=visibleMask, COMPLETE_PLAN=COMPLETE_PLAN, SAVED_PLAN=SAVED_PLAN, RUN_SOLVER=RUN_SOLVER)
  File "/home/pvela/python/puzzle_solver/puzzle/simulator/planner.py", line 138, in adapt
    self.manager.process(meaBoard)
  File "/home/pvela/python/puzzle_solver/puzzle/manager.py", line 354, in process
    self.measure(*argv)
  File "/home/pvela/python/puzzle_solver/puzzle/manager.py", line 116, in measure
    self.matchPieces()
  File "/home/pvela/python/puzzle_solver/puzzle/manager.py", line 185, in matchPieces
    self.pAssignments = self.hungarianAssignment(scoreTable_shape, scoreTable_color, scoreTable_edge_color)
  File "/home/pvela/python/puzzle_solver/puzzle/manager.py", line 211, in hungarianAssignment
    row_ind, col_ind = linear_sum_assignment(scoreTable_shape, maximize=True)
TypeError: linear_sum_assignment() got an unexpected keyword argument 'maximize'
pv33 commented

Looks to be a version issue. It got resolved and now there is a new problem to fix.

Might be nice to have a snapshot of a functional pip3 workspace.

Currently there is no reasonable dependency specification, or at least no one is maintaining it in the python package specification file. Closing this issue and making a new one requesting a revised setup.py file.

@yiyeChen @Uio96