cvlab-columbia/viper

Consider removing HiddenPrints?

apoorvkh opened this issue · 3 comments

I was trying to run your code (e.g. from vision_processes import forward), but the program would crash without my knowledge.

I believe the program crashed within a HiddenPrints context manager, in this case at:

viper/vision_models.py

Lines 1223 to 1224 in 03ba31e

with warnings.catch_warnings(), HiddenPrints("XVLM"):
model = XVLMBase(config_xvlm, use_contrastive_loss=True, vision_config=vision_config)

But accordingly, this never invoked HiddenPrints.__exit__

viper/utils.py

Line 194 in 03ba31e

def __exit__(self, exc_type, exc_val, exc_tb):

So I never discovered the issue and consequently nothing else in my program was able to print anything. I had no idea why and this was very difficult to debug.

Would you please consider removing HiddenPrints from this codebase? I think it is better to show extra warnings than to risk such "unknown crashes". Thanks!

Hi, can you comment out the line with warnings.catch_warnings(), HiddenPrints("XVLM"):? What error do you get?

And I agree that HiddenPrints can make things hard to debug, so I will add a flag to make it optional.

Update: I made HiddenPrints inactive by default

Great, thank you!

No worries about my specific issue. That was local and I fixed it (after commenting out HiddenPrints). Just wanted to point out my experience with HiddenPrints.