[FIX] TypeError in Image.fromarray by specifying dtype for video frames#27191
Closed
faaany wants to merge 0 commit intovllm-project:mainfrom
Closed
[FIX] TypeError in Image.fromarray by specifying dtype for video frames#27191faaany wants to merge 0 commit intovllm-project:mainfrom
TypeError in Image.fromarray by specifying dtype for video frames#27191faaany wants to merge 0 commit intovllm-project:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request correctly resolves a TypeError encountered during multimodal profiling when creating dummy video frames. The root cause was np.full defaulting to an int64 dtype, which is unsupported by PIL.Image.fromarray. By explicitly setting dtype=np.uint8, the change ensures compatibility with Pillow and also leads to more accurate memory profiling for video data. The fix is precise and effective. I've examined the related code and found no other instances of this issue. The change is good to merge.
Contributor
Author
Member
|
Can you fix DCO? |
deac577 to
b165fa3
Compare
aae81ad to
bfe0b4b
Compare
Contributor
Author
|
changes included in PR #27107. Close this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
This PR fixes a bug in the
profiling.pyfile that caused the following error when processing video frames:The issue occurred because the
np.fullcreated a NumPy array with the default data type int64 (<i8), which is not supported byPIL.Image.fromarray. TheImage.fromarrayfunction requires the array to have a supported data type, such asuint8for RGB images.Related Issue: https://stackoverflow.com/questions/79792709/how-can-i-serve-opengvlab-internvl3-1b-with-vllm-getting-valueerror-failed-to and
Test Plan
Below is a simple UT for the same issue:
By modifying the dtype, the UT can pass.
Test Result
Vllm Server can be started.
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.