[PR #151] [MERGED] In Compose, replace lambda function with named function #464

Closed
opened 2026-10-31 21:15:15 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/openai/CLIP/pull/151
Author: @janluke
Created: 9/10/2021
Status: ✅ Merged
Merged: 9/24/2021
Merged by: @jongwook

Base: main ← Head: fix/replace-lambda-in-compose


📝 Commits (1)

  • a63f881 In Compose, replace lambda function with named function

📊 Changes

1 file changed (+5 additions, -1 deletions)

View changed files

📝 clip/clip.py (+5 -1)

📄 Description

This prevents the following error on Windows (when using a multi-process DataLoader, for example):

AttributeError: Can't pickle local object '_transform.<locals>.<lambda>'

See https://discuss.pytorch.org/t/cant-pickle-local-object-dataloader-init-locals-lambda/31857


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/openai/CLIP/pull/151 **Author:** [@janluke](https://github.com/janluke) **Created:** 9/10/2021 **Status:** ✅ Merged **Merged:** 9/24/2021 **Merged by:** [@jongwook](https://github.com/jongwook) **Base:** `main` ← **Head:** `fix/replace-lambda-in-compose` --- ### 📝 Commits (1) - [`a63f881`](https://github.com/openai/CLIP/commit/a63f881a0158c99c6999eaf133ddb4f3ae0c24e8) In Compose, replace lambda function with named function ### 📊 Changes **1 file changed** (+5 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `clip/clip.py` (+5 -1) </details> ### 📄 Description This prevents the following error on Windows (when using a multi-process `DataLoader`, for example): ``` AttributeError: Can't pickle local object '_transform.<locals>.<lambda>' ``` See https://discuss.pytorch.org/t/cant-pickle-local-object-dataloader-init-locals-lambda/31857 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 21:15:15 +00:00
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#464
No description provided.