[GH-ISSUE #6] Error with custom image/title #4

Closed
opened 2026-10-31 21:09:48 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @dmoham1476 on GitHub (Jan 7, 2021).
Original GitHub issue: https://github.com/openai/CLIP/issues/6

When I try to add my image and description, am seeing this error. Does the input image need to be in any specific [format/resolution?]

Text(0.5, 1.0, 'Cosine similarity between text and image features')Error in callback <function install_repl_displayhook..post_execute at 0x7fd3eb1d1730> (for post_execute):

ValueError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/matplotlib/pyplot.py in post_execute()
107 def post_execute():
108 if matplotlib.is_interactive():
--> 109 draw_all()
110
111 # IPython >= 2

13 frames
/usr/local/lib/python3.6/dist-packages/matplotlib/colors.py in call(self, value, clip)
1015 result.fill(0) # Or should it be all masked? Or 0.5?
1016 elif vmin > vmax:
-> 1017 raise ValueError("minvalue must be less than or equal to maxvalue")
1018 else:
1019 if clip:

ValueError: minvalue must be less than or equal to maxvalue

ValueError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/IPython/core/formatters.py in call(self, obj)
332 pass
333 else:
--> 334 return printer(obj)
335 # Finally look for special method names
336 method = get_real_method(obj, self.print_method)

14 frames
/usr/local/lib/python3.6/dist-packages/matplotlib/colors.py in call(self, value, clip)
1015 result.fill(0) # Or should it be all masked? Or 0.5?
1016 elif vmin > vmax:
-> 1017 raise ValueError("minvalue must be less than or equal to maxvalue")
1018 else:
1019 if clip:

ValueError: minvalue must be less than or equal to maxvalue

Originally created by @dmoham1476 on GitHub (Jan 7, 2021). Original GitHub issue: https://github.com/openai/CLIP/issues/6 When I try to add my image and description, am seeing this error. Does the input image need to be in any specific [format/resolution?] Text(0.5, 1.0, 'Cosine similarity between text and image features')Error in callback <function install_repl_displayhook.<locals>.post_execute at 0x7fd3eb1d1730> (for post_execute): --------------------------------------------------------------------------- ValueError Traceback (most recent call last) /usr/local/lib/python3.6/dist-packages/matplotlib/pyplot.py in post_execute() 107 def post_execute(): 108 if matplotlib.is_interactive(): --> 109 draw_all() 110 111 # IPython >= 2 13 frames /usr/local/lib/python3.6/dist-packages/matplotlib/colors.py in __call__(self, value, clip) 1015 result.fill(0) # Or should it be all masked? Or 0.5? 1016 elif vmin > vmax: -> 1017 raise ValueError("minvalue must be less than or equal to maxvalue") 1018 else: 1019 if clip: ValueError: minvalue must be less than or equal to maxvalue --------------------------------------------------------------------------- ValueError Traceback (most recent call last) /usr/local/lib/python3.6/dist-packages/IPython/core/formatters.py in __call__(self, obj) 332 pass 333 else: --> 334 return printer(obj) 335 # Finally look for special method names 336 method = get_real_method(obj, self.print_method) 14 frames /usr/local/lib/python3.6/dist-packages/matplotlib/colors.py in __call__(self, value, clip) 1015 result.fill(0) # Or should it be all masked? Or 0.5? 1016 elif vmin > vmax: -> 1017 raise ValueError("minvalue must be less than or equal to maxvalue") 1018 else: 1019 if clip: ValueError: minvalue must be less than or equal to maxvalue <Figure size 1440x1008 with 1 Axes>
Author
Owner

@jongwook commented on GitHub (Jan 8, 2021):

Hi, I believe this happened while calling plt.imshow on the similarity matrix. (let me know if it wasn't)

I had only vmax=0.3 specified, and this error might have happened when the minimum value of your matrix was above 0.3.

In the latest commit (ebd0e35aac) I added vmin=0.1 to the imshow() call, which should prevent this error. Let me know if this fixes the problem - thanks!

<!-- gh-comment-id:756915651 --> @jongwook commented on GitHub (Jan 8, 2021): Hi, I believe this happened while calling `plt.imshow` on the `similarity` matrix. (let me know if it wasn't) I had only `vmax=0.3` specified, and this error might have happened when the minimum value of your matrix was above 0.3. In the latest commit (ebd0e35aac063855694a1e6d2f6b2181acb7af0b) I added `vmin=0.1` to the `imshow()` call, which should prevent this error. Let me know if this fixes the problem - thanks!
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openai/CLIP#4
No description provided.