Dataset object has no attribute `to_tf_dataset`
NONE
The issue is due to the older version of transformers and datasets. It has been resolved by upgrading their versions.

```
# upgrade transformers and datasets to latest versions
!pip install --upgrade transformers
!pip install --upgrade datasets
```

Regards!
2021-11-21T07:07:25Z
https://github.com/huggingface/datasets/issues/3304#issuecomment-974766493
https://api.github.com/repos/huggingface/datasets/issues/3304
IC_kwDODunzps46GcGd
https://api.github.com/repos/huggingface/datasets/issues/comments/974766493/reactions
2021-11-21T07:07:25Z
https://api.github.com/repos/huggingface/datasets/issues/comments/974766493
https://avatars.githubusercontent.com/u/59993678?v=4
https://api.github.com/users/RajkumarGalaxy/events{/privacy}
https://api.github.com/users/RajkumarGalaxy/followers
https://api.github.com/users/RajkumarGalaxy/following{/other_user}
https://api.github.com/users/RajkumarGalaxy/gists{/gist_id}
https://github.com/RajkumarGalaxy
RajkumarGalaxy
MDQ6VXNlcjU5OTkzNjc4
https://api.github.com/users/RajkumarGalaxy/orgs
https://api.github.com/users/RajkumarGalaxy/received_events
https://api.github.com/users/RajkumarGalaxy/repos
https://api.github.com/users/RajkumarGalaxy/starred{/owner}{/repo}
https://api.github.com/users/RajkumarGalaxy/subscriptions
User
https://api.github.com/users/RajkumarGalaxy
public
I am following HuggingFace Course. I am at Fine-tuning a model. 
Link: https://huggingface.co/course/chapter3/2?fw=tf

I use tokenize_function and `map` as mentioned in the course to process data.

`# define a tokenize function`
`def Tokenize_function(example):`
`    return tokenizer(example['sentence'], truncation=True)`

`# tokenize entire data`
`tokenized_data = raw_data.map(Tokenize_function, batched=True)`

I get Dataset object at this point. When I try converting this to a TF dataset object as mentioned in the course, it throws the following error.

`# convert to TF dataset`
`train_data = tokenized_data["train"].to_tf_dataset( `
`   columns = ['attention_mask', 'input_ids', 'token_type_ids'], `
`    label_cols = ['label'], `
`    shuffle = True, `
`    collate_fn = data_collator, `
`    batch_size = 8 `
`)`

Output:

`---------------------------------------------------------------------------`
`AttributeError                            Traceback (most recent call last)`
`/tmp/ipykernel_42/103099799.py in <module>`
`      1 # convert to TF dataset`
`----> 2 train_data = tokenized_data["train"].to_tf_dataset( \`
`      3     columns = ['attention_mask', 'input_ids', 'token_type_ids'], \`
`      4     label_cols = ['label'], \`
`      5     shuffle = True, \`
`AttributeError: 'Dataset' object has no attribute 'to_tf_dataset'`

When I look for `dir(tokenized_data["train"])`, there is no method or attribute in the name of `to_tf_dataset`.

Why do I get this error? And how to clear this?

Please help me.