Dataset object has no attribute `to_tf_dataset`
{'login': 'RajkumarGalaxy', 'id': 59993678, 'node_id': 'MDQ6VXNlcjU5OTkzNjc4', 'avatar_url': 'https://avatars.githubusercontent.com/u/59993678?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/RajkumarGalaxy', 'html_url': 'https://github.com/RajkumarGalaxy', 'followers_url': 'https://api.github.com/users/RajkumarGalaxy/followers', 'following_url': 'https://api.github.com/users/RajkumarGalaxy/following{/other_user}', 'gists_url': 'https://api.github.com/users/RajkumarGalaxy/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/RajkumarGalaxy/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/RajkumarGalaxy/subscriptions', 'organizations_url': 'https://api.github.com/users/RajkumarGalaxy/orgs', 'repos_url': 'https://api.github.com/users/RajkumarGalaxy/repos', 'events_url': 'https://api.github.com/users/RajkumarGalaxy/events{/privacy}', 'received_events_url': 'https://api.github.com/users/RajkumarGalaxy/received_events', 'type': 'User', 'site_admin': False}
[{'id': 1935892857, 'node_id': 'MDU6TGFiZWwxOTM1ODkyODU3', 'url': 'https://api.github.com/repos/huggingface/datasets/labels/bug', 'name': 'bug', 'color': 'd73a4a', 'default': True, 'description': "Something isn't working"}]
[]
['The issue is due to the older version of transformers and datasets. It has been resolved by upgrading their versions.\r\n\r\n```\r\n# upgrade transformers and datasets to latest versions\r\n!pip install --upgrade transformers\r\n!pip install --upgrade datasets\r\n```\r\n\r\nRegards!']
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.
{'url': 'https://api.github.com/repos/huggingface/datasets/issues/3304/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}