question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add Native Support for Fastai Tensor Types

See original GitHub issue

fastai extends PyTorch’s tensors to have custom data types like TensorCategory, etc. I’m not sure how exactly the WandbCallback for fastai works but I assume it converts them to PyTorch tensors when passing it to Wandb’s JSONEncoders.

Do you think it makes sense to add native support for this? It would require modifying wandb/util.py like so:

def is_fastai_tensor_typename(typename):
    # restrict to TensorCategory and TensorMultiCategory?
    return typename.startswith('fastai') and 'Tensor' in typename

def json_friendly(obj):
    ...
    elif is_pytorch_tensor_typename(typename) or is_fastai_tensor_typename(typename):
    ...

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rsomani95commented, Oct 21, 2020

@borisdayma I was actually only trying to use the standard W&B callback with the PyTorch 1.8 nightly version. Not trying to log anything extra.

After making the changes mentioned in the related fastai issue – specifically commenting out _patch_tb() here, I ran into the tensor type conversion issue which I was able to bypass making the changes I proposed above.

However, using the fastai W&B callback now leads to a python multiprocessing error that I’m not sure how to debug, so I decided to stop hacking around and let the official versions release.

I do not have a colab notebook for you to try out. Is the description above specific enough? It’s tricky to reproduce because I’ve made modifications to both fastai and w&b source. LMK if you plan on tackling this and how I can be of better help.

Also should we try to close the related fastai issue first?

Sure! I’m just not sure how to proceed

EDIT: I can reproduce my steps in an isolated environment and post the specific error messages here

1reaction
issue-label-bot[bot]commented, Oct 17, 2020

Issue-Label Bot is automatically applying the label feature_request to this issue, with a confidence of 0.94. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add Native Support for Fastai Tensor Types #1378 - GitHub
fastai extends PyTorch's tensors to have custom data types like TensorCategory, etc. ... Add Native Support for Fastai Tensor Types #1378.
Read more >
Torch Core - fastai
Torch Core · Arrays and show · Basics · Tensor subtypes · Chunks · Simple types · Other functions · Image helpers ·...
Read more >
fastai - Welcome to fastai
fastai simplifies training fast and accurate neural nets using modern best practices. ... system for Python along with a semantic type hierarchy for...
Read more >
Data block tutorial - fastai
In this tutorial, we'll see how to use the data block API on a variety of tasks and how to debug data blocks....
Read more >
Tabular core - fastai
Helper function that adds columns relevant to a date in the column field_name of df . For example if we have a series...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found