Skip to content

fix: update deprecated torchvision make_grid API and resolve DataLoader worker import failures#555

Open
Fahmid-Arman wants to merge 1 commit into
kubeedge:mainfrom
Fahmid-Arman:fix-issue-472-erfnet-torchvision-dataloader
Open

fix: update deprecated torchvision make_grid API and resolve DataLoader worker import failures#555
Fahmid-Arman wants to merge 1 commit into
kubeedge:mainfrom
Fahmid-Arman:fix-issue-472-erfnet-torchvision-dataloader

Conversation

@Fahmid-Arman

Copy link
Copy Markdown

What type of PR is this?
/kind bug

What this PR does / why we need it:
The ERFNet training pipeline crashed on modern Python environments due to two separate execution failures involving deprecated APIs and subprocess module imports.

  • Renamed the deprecated range keyword argument to value_range across all torchvision.utils.make_grid() calls in utils/summaries.py to restore compatibility with torchvision >= 0.8.0.
  • Updated self.workers = 0 within TrainArgs in utils/args.py to force PyTorch DataLoader to run in the main process. This prevents worker subprocesses from crashing with ModuleNotFoundError due to lost sys.path modifications.

Which issue(s) this PR fixes:
Fixes #472

@kubeedge-bot kubeedge-bot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 15, 2026
@kubeedge-bot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Fahmid-Arman
To complete the pull request process, please assign jaypume after the PR has been reviewed.
You can assign the PR to them by writing /assign @jaypume in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubeedge-bot kubeedge-bot requested review from Poorunga and hsj576 June 15, 2026 22:20
@kubeedge-bot kubeedge-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 15, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates make_grid calls in summaries.py to use value_range instead of range and sets the default number of workers to 0 in args.py. The reviewer recommends making the number of workers configurable via kwargs instead of hardcoding it to 0 to avoid bottlenecking training performance.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

…er worker import failures

Signed-off-by: Fahmid Arman <fahmid.brac@gmail.com>
@Fahmid-Arman Fahmid-Arman force-pushed the fix-issue-472-erfnet-torchvision-dataloader branch from 3e9211c to 58e7ed5 Compare June 15, 2026 22:22
@Fahmid-Arman

Copy link
Copy Markdown
Author

Feedback addressed:

  • Made the DataLoader workers parameter configurable via kwargs to support multi-process loading overrides while keeping 0 as the safe default.

/assign @jaypume

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Categorizes issue or PR as related to a bug. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] ERFNet training fails with deprecated torchvision API and DataLoader worker import errors in robot-cityscapes-synthia example

3 participants