Comments (1)
I set some debug point and it turns out there is nothing yield in the for loop of a ffcv loader:
for ix, (images, target) in enumerate(train_loader): .....
I define the train_loader as follows:
def create_train_loader(self, train_dataset, num_workers, batch_size,
distributed, in_memory):
this_device = f'cuda:{self.gpu}'
train_path = Path(train_dataset)
assert train_path.is_file()
res = self.get_resolution(epoch=0)
self.decoder = RandomResizedCropRGBImageDecoder((res, res))
gaussian_kernel_size = 5
sigma = 2
image_pipeline: List[Operation] = [
self.decoder,
RandomHorizontalFlip(),
ToTensor(),
transforms.RandomApply([transforms.GaussianBlur(gaussian_kernel_size, sigma)], p=0.5),
ToDevice(ch.device(this_device), non_blocking=True),
ToTorchImage(),
NormalizeImage(IMAGENET_MEAN, IMAGENET_STD, np.float16)
]
label_pipeline: List[Operation] = [
IntDecoder(),
ToTensor(),
Squeeze(),
ToDevice(ch.device(this_device), non_blocking=True)
]
order = OrderOption.RANDOM if distributed else OrderOption.QUASI_RANDOM
loader = Loader(train_dataset,
batch_size=batch_size,
num_workers=num_workers,
order=order,
os_cache=in_memory,
drop_last=True,
pipelines={
'image': image_pipeline,
'label': label_pipeline
},
distributed=distributed)
print("loader: ", loader)
return loader
Could really use some insights!!!
from ffcv.
Related Issues (20)
- ModuleNotFoundError: No module named 'ffcv.compiler
- doubt about mutli-gpu train when use imagenet 4 gpus HOT 1
- Default num_workers is incompatible with SLURM
- Installing FFCV on CPU-only node HOT 1
- Exact performance improvement
- Unable to save anything in the Fields HOT 1
- Compression error causes performance drop
- Reuse memory?
- Installing ffcv fails HOT 1
- Unexpected output with BytesField, question for genomics
- Wrong version reported in FFCV 1.0.2
- Numba typing error: Cannot determine Numba type of <class 'ffcv.transforms.module.ModuleWrapper'> HOT 2
- pip install uses system python instead of conda python HOT 1
- FFCV 3D
- How to implement a transform that tokenize text? HOT 2
- Plans to concatenate FFCV dataloaders?
- Error in */ffcv/pipeline/graph.py: "AttributeError: 'str' object has no attribute 'type'" HOT 2
- Is there a get_batch(indices) method + custom collate function? HOT 1
- Google Colab Error with CIFAR-10 example: "ValueError: The number of threads must be between 1 and 2"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ffcv.