Below code in Mnist DataLoader is giving error:
ToTensor
converts the image data from uint8 to 32-bit floating point. It
divides all numbers by 255 so that all pixel values are between 0 and 1
transformer = gluon.data.vision.transforms.ToTensor()
train_iter = gluon.data.DataLoader(mnist_train.transform_first(transformer), batch_size,
shuffle = True, num_workers=get_dataloader_workers)
TypeError Traceback (most recent call last)
in
3
4 transformer = gluon.data.vision.transforms.ToTensor()
----> 5 train_iter = gluon.data.DataLoader(mnist_train.transform_first(transformer), batch_size, shuffle = True,
6 num_workers=get_dataloader_workers)
c:\users\priya ranjan kumar.conda\envs\d2l\lib\site-packages\mxnet\gluon\data\dataloader.py in init(self, dataset, batch_size, shuffle, sampler, last_batch, batch_sampler, batchify_fn, num_workers, pin_memory, pin_device_id, prefetch, thread_pool, timeout)
605
606 self._batch_sampler = batch_sampler
–> 607 self._num_workers = num_workers if num_workers >= 0 else 0
608 self._worker_pool = None
609 self._prefetch = max(0, int(prefetch) if prefetch is not None else 2 * self._num_workers)
TypeError: ‘>=’ not supported between instances of ‘function’ and ‘int’