-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image output of NVDS
is invalid
#28
Comments
In order to debug this more, and because it seems generally useful to others, I created a simple version of And in But I get this from the first depth image created by Here is the code - perhaps you understand it better and will see that something is wrong with it? Or maybe you could run it on your machine and see if it works for you? You can run it with Note that I have only implemented the
PS. Here are my logs if it helps:
|
I ran your code, I had to alter some small things to get it to run on CUDA. Looks ok to me. But is it a good idea to store it as 16bit png? Would it not be better to user 32bit float in a exr file? I uploaded the results here https://ludvig-betong.filemail.com/d/agdtxtcjrtwszao |
Thanks for running it! I don't know about 16 vs 32 bit, I was just copying code existing in the repo already. But could be nice to change to 32. Would you mind sharing your code with the modifications? Maybe something that you had to fix for CUDA will also fix my issue. Thanks! |
If I remember correctly I commented out :
And maybe added ("cuda:0") somewhere. Regarding the 16/32 float to int issue I think you loose some gradients when converting back and forth. So I imagine it would be best to just keep it in float all the way. I think you can store float in PNGs but maybe you have to modify it slightly, OpenEXR image files handles float without any modifications. Easiest way to use exr is with OpenImageIO. |
Thanks @luuude. I did find out the potential cause of this bug, which is that if I use
Not quite sure which it is, but if anyone has suggestions to debug, would love to hear! |
hi, i located the issue huggingface/transformers#22468
|
Hi @bigipalabom, amazing, that is a great find, thank you! And beyond it being a great find, it looks like it worked 😁 In
I don't know enough PyTorch to understand if there are potential issues with this change. But cc @RaymondWang987, this seems like a nice update to make if it seems safe? It will unblock other Mac users who want to use MPS acceleration. |
Great work @jparismorgan @bigipalabom ! I've tried to understand the issue a little deeper: the .contiguous() seems to be about the memory allocation of the tensors according to this post. In the corresponding commits I checked for activity mentioning GELU and found a couple of people working on it in the past. Maybe one of you can help, @malfet @qqaatw @DenisVieriu97 ? My best guess is that there's an assumption in the MPS GELU implementation that the tensor memory is contiguous but that's usually not the case. Unfortunately my Objective-C is non-existent 😉 |
Haha, glad it hepled. I remember Apple has similar problem ever since ancient macintosh time, as per Apple, "Think different" |
Hi there, I'm trying to run
infer_NVDS_dpt_bi.py
on some images with(NVDS) ~/repo/NVDS python infer_NVDS_dpt_bi.py --base_dir ./demo_outputs/dpt_init/000423/ --vnum 000423 --infer_w 896 --infer_h 384
using an M2 Macbook Pro (I changed thedevice
to usecpu
).When I run, the normal depth network results look okay, i.e.
demo_outputs/dpt_init/000423/initial/gray/frame_000000.png
:But the results of the
NVDS
forward pass are all black, i.e.demo_outputs/dpt_init/000423/1/gray/frame_000000.png
:and
demo_outputs/dpt_init/000423/1/color/0.png
:These are my installed packages:
Curious if you have seen this before or have any suggestions to debug this? Thank you!
The text was updated successfully, but these errors were encountered: