med-air / SurRoL

[IROS'21] SurRoL: An Open-source Reinforcement Learning Centered and dVRK Compatible Platform for Surgical Robot Learning
https://med-air.github.io/SurRoL/
MIT License
119 stars 19 forks source link

Raising EOF Error. #10

Closed HariOm2413 closed 5 months ago

HariOm2413 commented 6 months ago

First off, I am new to github so I apologize if the format of the issue is wrong.

The issue I am having is that the program raises an EOF Error when I run the bash files using ./bashfilename.

I was able to debug the program and figure out that the issue only occurs when n == 0 and remaining is equal to size, but remaining and size being equal is not possible unless size is zero which leads me to believe that the data file being passed is an empty datafile.

def _recv(self, size, read=_read): buf = io.BytesIO() handle = self._handle remaining = size print("Start of the while loop") while remaining > 0: chunk = read(handle, remaining) n = len(chunk) print("handle is:", handle) print("n is:",n) print("remaining is:",remaining) if n == 0: print("Code is here") if remaining == size: print("Remaining is equal to size") raise EOFError else: raise OSError("got end of file during message")

That is the code I have in my connections.py in the conda folder of my linux dist. I modified it a little for debugging purposes. Is there any fix or something I need to do differently, thanks for the advice.

HariOm2413 commented 6 months ago

Sorry accidentally closed the issue. Could there also be a problem with the data generation code?

fujiawei0724 commented 6 months ago

Hello, could you please provide more detail about this problem, which bashfile did you run and raise this problem?

wwdda commented 6 months ago

Hi HariOm2413, thanks for using surrol and opening this issue. Could you please tell me which version(branch) you're currently using? In fact, there's a guide for installation inside the readme file for both main and surrol-v2 branches, which you could follow to install and test. Normally, the .sh file will not be needed when using surrol. If you use main branch, just cd to surrol/tasks/ and execute a python file is OK; if you use surrol-v2, you may need a haptic device at hand and configure it following the "Control with Touch Haptic Device" section in readme. Besides, could you please elaborate the problem you've encountered for data generation?

HariOm2413 commented 6 months ago

It was her_ecmreach.sh was the bashfile. I am using the main branch. Also the programs in the task folder work for me so thanks for the suggestion. For some of them the program only runs for a couple of seconds because it will finish.

wwdda commented 6 months ago

For the bash file error, I think it may result from missing dependencies. If you'd like to test and evaluate the rl algorithm performance, you could refer to DEX repo and follow its guide on registering SurRoL tasks and evaluating saved models. As for program finishing, it was set by us on purpose to quit the program either when it has completed the task or it exceeds the time limit. For details, you could refer to this and modify the condition as you like.