# Is 1 week of course mostely inactual with new tf versions?

**URL:** <https://community.deeplearning.ai/t/is-1-week-of-course-mostely-inactual-with-new-tf-versions/430760>\
**Category:** Natural Language Processing in TensorFlow\
**Tags:** week-module-1\
**Created:** [August 28, 2023, 8:16pm UTC](https://community.deeplearning.ai/t/is-1-week-of-course-mostely-inactual-with-new-tf-versions/430760 "2023-08-28T20:16:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![someone555777](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@someone555777](https://community.deeplearning.ai/u/someone555777)\
**Post date:** [August 28, 2023, 8:16pm UTC](https://community.deeplearning.ai/t/is-1-week-of-course-mostely-inactual-with-new-tf-versions/430760/1 "2023-08-28T20:16:01Z")

</div>

Just found that due to deprecated module “preprocessing” the [Tokenizer](https://www.tensorflow.org/api_docs/python/tf/keras/preprocessing/text/Tokenizer) and another usfull funcs haven’t worked already. And developers changed it on TextVetorization layer that can be called just from model.

After I saw this I understood that I don’t completely understand the concept of TensorFlow. Do I understand correct, that developers don’t like when any steps can be used without models? Why is it? It looks really exsessive when I just want to try to check the working of any features/apis but need to create a model for this. Also, any of funcs can be defined by developers of TF as step in model and as potential Layer, isn’t it?

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [August 29, 2023, 3:55am UTC](https://community.deeplearning.ai/t/is-1-week-of-course-mostely-inactual-with-new-tf-versions/430760/2 "2023-08-29T03:55:09Z")

</div>

Please read [this](https://community.deeplearning.ai/t/is-the-tokenizer-deprecated-and-no-longer-recommended-for-being-used/276910/4)

The exam expects you to upload the fit model. So, the system doesn’t care if you use a deprecated API. The recommended APIs use GPU effectively and so have better performance over the deprecated APIs that use CPU.

The staff are aware of usage of deprecated APIs and will update the notebooks.

---

<div class="post-metadata">

**Author:** ![someone555777](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@someone555777](https://community.deeplearning.ai/u/someone555777)\
**Post date:** [August 29, 2023, 8:12pm UTC](https://community.deeplearning.ai/t/is-1-week-of-course-mostely-inactual-with-new-tf-versions/430760/3 "2023-08-29T20:12:12Z")

</div>

ok, thanks. So, do I understand correct the tendency?

> [@someone555777](#):
>
> Do I understand correct, that developers don’t like when any steps can be used without models? Why is it? It looks really exsessive when I just want to try to check the working of any features/apis but need to create a model for this. Also, any of funcs can be defined by developers of TF as step in model and as potential Layer, isn’t it?

Is usage of GPU the one reason of the functionality transfer to Layers?

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [August 30, 2023, 8:01am UTC](https://community.deeplearning.ai/t/is-1-week-of-course-mostely-inactual-with-new-tf-versions/430760/4 "2023-08-30T08:01:11Z")

</div>

Performance is one of the main reasons for deprecation of `tf.keras.preprocessing` layers.

For instance, when using `image_dataset_from_directory`, augmentations are done in layers within the model which internally uses GPU. `ImageDataGenerator` uses CPU to perform augmentations prior to feeding data into the model.

I’ve observed a good amount of difference when it comes to training time when using the newer recommended APIs.

---

<div class="post-metadata">

**Author:** ![someone555777](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@someone555777](https://community.deeplearning.ai/u/someone555777)\
**Post date:** [September 6, 2023, 5:26pm UTC](https://community.deeplearning.ai/t/is-1-week-of-course-mostely-inactual-with-new-tf-versions/430760/5 "2023-09-06T17:26:58Z")

</div>

additionally I found answers in [Keras documentation](https://keras.io/getting_started/intro_to_keras_for_engineers/)

> **The ideal machine learning model is end-to-end**
> 
> In general, you should seek to do data preprocessing **as part of your model** as much as possible, not via an external data preprocessing pipeline. That’s because external data preprocessing makes your models less portable when it’s time to use them in production. Consider a model that processes text: it uses a specific tokenization algorithm and a specific vocabulary index. When you want to ship your model to a mobile app or a JavaScript app, you will need to recreate the exact same preprocessing setup in the target language. This can get very tricky: any small discrepancy between the original pipeline and the one you recreate has the potential to completely invalidate your model, or at least severely degrade its performance.
> 
> It would be much easier to be able to simply export an end-to-end model that already includes preprocessing. **The ideal model should expect as input something as close as possible to raw data: an image model should expect RGB pixel values in the `[0, 255]` range, and a text model should accept strings of `utf-8` characters.** That way, the consumer of the exported model doesn’t have to know about the preprocessing pipeline.
