Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix translate fill #184

Merged
merged 4 commits into from
Aug 20, 2022
Merged

Fix translate fill #184

merged 4 commits into from
Aug 20, 2022

Conversation

andrewilyas
Copy link
Contributor

The translate transformation used to ignore its fill parameter and just use whatever happened to be in the dst tensor. This fixes that.

@lengstrom
Copy link
Contributor

Tried running this and was missing the astor pip dependency

@lengstrom
Copy link
Contributor

lengstrom commented Mar 9, 2022

also get the following error when making a CIFAR data loader: (this is fixed by using the pip version of FFCV)

Traceback (most recent call last):
  File "/mnt/nfs/home/engstrom/conda_envs/ffcvrgb/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/mnt/nfs/home/engstrom/conda_envs/ffcvrgb/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/mnt/nfs/home/engstrom/src/datamodeler/datamodels/training/worker.py", line 94, in <module>
    main()
  File "/mnt/nfs/home/engstrom/conda_envs/ffcvrgb/lib/python3.9/site-packages/fastargs/decorators.py", line 63, in result
    return func(*args, **kwargs)
  File "/mnt/nfs/home/engstrom/conda_envs/ffcvrgb/lib/python3.9/site-packages/fastargs/decorators.py", line 35, in __call__
    return self.func(*args, **filled_args)
  File "/mnt/nfs/home/engstrom/src/datamodeler/datamodels/training/worker.py", line 76, in main
    to_log = module.main(index=index, logdir=worker_logs)
  File "/mnt/nfs/home/engstrom/src/membership_inference/cifar10/train_cifar.py", line 174, in main
    loaders = make_dataloaders(mask=np.nonzero(mask)[0])
  File "/mnt/nfs/home/engstrom/conda_envs/ffcvrgb/lib/python3.9/site-packages/fastargs/decorators.py", line 63, in result
    return func(*args, **kwargs)
  File "/mnt/nfs/home/engstrom/conda_envs/ffcvrgb/lib/python3.9/site-packages/fastargs/decorators.py", line 35, in __call__
    return self.func(*args, **filled_args)
  File "/mnt/nfs/home/engstrom/src/membership_inference/cifar10/train_cifar.py", line 86, in make_dataloaders
    loaders[name] = Loader(paths[name], indices=(mask if name == 'train' else None),
  File "/mnt/nfs/home/engstrom/src/ffcvrgb/ffcv/loader/loader.py", line 210, in __init__
    self.generate_code()
  File "/mnt/nfs/home/engstrom/src/ffcvrgb/ffcv/loader/loader.py", line 275, in generate_code
    queries, code = self.graph.collect_requirements()
  File "/mnt/nfs/home/engstrom/src/ffcvrgb/ffcv/pipeline/graph.py", line 347, in collect_requirements
    self.collect_requirements(next_state, node, allocations, code, source_field=source_field)
  File "/mnt/nfs/home/engstrom/src/ffcvrgb/ffcv/pipeline/graph.py", line 347, in collect_requirements
    self.collect_requirements(next_state, node, allocations, code, source_field=source_field)
  File "/mnt/nfs/home/engstrom/src/ffcvrgb/ffcv/pipeline/graph.py", line 347, in collect_requirements
    self.collect_requirements(next_state, node, allocations, code, source_field=source_field)
  [Previous line repeated 3 more times]
  File "/mnt/nfs/home/engstrom/src/ffcvrgb/ffcv/pipeline/graph.py", line 328, in collect_requirements
    if next_state.device.type != 'cuda' and isinstance(operation,
AttributeError: 'str' object has no attribute 'type'

If the problem isn't immediately obvious I can debug / make a test case.

@andrewilyas
Copy link
Contributor Author

I think these are both properties in the v1.0.0 branch and not of the specific pull request---I can make a few new pull requests to fix these issues (should just be a matter of removing an import astor and changing the string device to ch.device.

@andrewilyas
Copy link
Contributor Author

Merging this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants