Closed AymenFJA closed 5 years ago
any updates? :-)
@lmhieu612 It looks like models.py is missing?
Hi @AymenFJA, sorry I haven't noticed that we have an open issue.
I can't reproduce the bug. My best guess is that you need to add the folder "models" into the system path. It's running fine in my env here even though I am not doing that. I use python 2.7.
Ping me in slack so I could assist you more easily :)
Hello @lmhieu612 ,
Not a problem, In the readme file the prerequisites of the Penguins code is Pythpn3
so I installed it. I will try to install python 2.7, export the path and update this ticket. Also, it would be easier for me to keep doing issue tracking and solving through GitHub.
Thanks for the help.
@AymenFJA, try to include file path to $PYTHONPATH
and report back. It makes sense to include all the steps taken to create the environment
In predict.py, can you please try adding this line: sys.path.insert(0, "./../..")
May I suggest that do export PYTHONPATH=.....:$PYTHONPATH
?
Steps I did base on @lmhieu612 and @iparask suggestions :
Python 2.7.16 |Anaconda
Interact -gpu
on bridges.export PYTHONPATH=/Penguins/src:$PYTHONPATH
python src/predicting/predict.py --gpu_ids 0 --name v3weakly_unetr_bs96_main_model_ignore_bad --epoch 300 --checkpoints_dir 'checkpoints_dir/checkpoints_CVPR19W/' --output test --testset GE --input_im pengui.png
I got another error :
Traceback (most recent call last): File "src/predicting/predict.py", line 244, in <module> a.test_single_png(opt.input_im) File "src/predicting/predict.py", line 237, in test_single_png outpng = self.png_predict(inpng) File "src/predicting/predict.py", line 105, in png_predict w,h,c = im.shape ValueError: need more than 2 values to unpack
.
any idea why?
Thanks.
What is your input image? Do you need the full path or at least a './'? Are you on /pylon5? Can you make it group readable and @lmhieu612 and I can take a look.
@bspitzbart
My input image is from WV02-penguins
images in the google drive, I extracted 256x256
and converted it to a PNG
image, I verified that the image is not corrupted, also I don't think I need the full path. The error is rising from the following: w,h,c = im.shape
, I tried to switch from opencv2 to opencv3 but the error is the same.
I think the problem is with my PNG input image type, can you please provide me with a sample input image for testing. thanks @bspitzbart
/pylon5/mc3bggp/bspitz/Penguins/Testing/Input
I think it's very likely that you used a gray image for testing while the current model is for the RGB images.
I tried one of the images that @bspitzbart sent in the dir path above, and I am getting this error :
File "src/predicting/predict.py", line 246, in <module>
a.test_single_png(opt.input_im)
File "src/predicting/predict.py", line 239, in test_single_png
outpng = self.png_predict(inpng)
File "src/predicting/predict.py", line 141, in png_predict
outpng = patches2png_legacy(out,w,h,opt.step,opt.size)
File "/home/aymen/SummerRadical/Penguins/src/data_processing/m_im_util.py", line 122, in patches2png_legacy
tif = np.zeros((1,w,h))
TypeError: 'tuple' object cannot be interpreted as an index```
can you print what is "w" and "h" in here? they should be 256.
I guess I need an account in Bridge
Hello @lmhieu612 ,
So just to be clear, i am using the same image as you stated in the Readme file, I printed both values and this is what I got :
----------------------
w = (2153, 2150, 3)
h = (2153, 2150, 3)
----------------------
Hello @lmhieu612 were you able to run the code on Bridges?
Thanks.
Hi @AymenFJA,
Please check out the minor_fix branch and see if it could help. I ran it on Bridges without any error.
Sure, I will follow these instructions and update the ticket ASAP. Thanks, @lmhieu612
Yes, I did git checkout to minor_fix
now and it is working. Thanks, @lmhieu612 .
This ticket will be closed for now.
Excellent. Thanks @Aymen afa64@scarletmail.rutgers.edu and @Hieu Le hieu.le@stonybrook.edu.
On Wed, Jun 5, 2019 at 2:53 PM Aymen Alsaadi notifications@github.com wrote:
Yes, I did git checkout to minor_fix now and it is working. Thanks, @lmhieu612 https://github.com/lmhieu612 .
This ticket will be closed for now.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/iceberg-project/Penguins/issues/7?email_source=notifications&email_token=AAN5FW4WKAH7JMSJE6GIYUTPZADQNA5CNFSM4HKL5OEKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXAVPVY#issuecomment-499210199, or mute the thread https://github.com/notifications/unsubscribe-auth/AAN5FW6XMKOPKLM2YN6Y5PTPZADQNANCNFSM4HKL5OEA .
Sorry, based on that, can we please open a pull request for this fix to the devel branch, please ? @bspitzbart @lmhieu612
Thanks again.
Hello @lmhieu612 :
I was trying to run the penguins code on Bridges and I followed your instructions and how to install all the dependencies, I followed the command example in the readme you provided and I did the following :
python predict.py --gpu-ids 0 --name v3weakly_unetr_bs96_main_model_ignore_bad --epoch 300 --checkpoints_dir checkpoints_dir/checkpoints_v3weakly_unetr_bs96_main_model_ignore_bad/ --output test --testset GE --input_im /pylon5/mc3bggp/aymen/img.png
also i am using
python3
and I got the following error :
File "src/predicting/predict.py", line 13, in <module> from models import create_model ModuleNotFoundError: No module named 'models'
am i doing something wrong ? can you help, please.