<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ana Paula Appel on Medium]]></title>
        <description><![CDATA[Stories by Ana Paula Appel on Medium]]></description>
        <link>https://medium.com/@anaappel?source=rss-6f5bf2da87cf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*EbibkNJqmkHDXp0yo3G1rw.png</url>
            <title>Stories by Ana Paula Appel on Medium</title>
            <link>https://medium.com/@anaappel?source=rss-6f5bf2da87cf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 09:03:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@anaappel/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Handle Kernel Restart on Jobs in Watson Studio]]></title>
            <link>https://anaappel.medium.com/handle-kernel-restart-on-jobs-in-watson-studio-67ce94e68d9d?source=rss-6f5bf2da87cf------2</link>
            <guid isPermaLink="false">https://medium.com/p/67ce94e68d9d</guid>
            <category><![CDATA[kernel-re-start]]></category>
            <category><![CDATA[cp4d]]></category>
            <category><![CDATA[watson-studio]]></category>
            <category><![CDATA[ibm]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Ana Paula Appel]]></dc:creator>
            <pubDate>Mon, 14 Mar 2022 12:00:56 GMT</pubDate>
            <atom:updated>2022-03-14T12:00:56.426Z</atom:updated>
            <content:encoded><![CDATA[<p>When working with an NLP problem is common to have to install extra packages from TensorFlow like Keras, Tensor Hub, and Text.</p><p>Working in a notebook python in interactive mode is easy to install new packages and restarting the kernel. However, when we deal with large datasets to generate embeddings, for instance, running a notebook interactively is prohibitive.</p><p>Last week I was working on a project that I need to create embedding using USE (Universal Sentence Embedding) for 500 thousand sentences (each one with around 6 words) and for that I need to create a job to run my notebook.</p><p>In Watson Studio every time that you run a job is necessary to install all the packages that are not pre-installed and after that TensorFlow packages needed to restart the kernel.</p><p>After my crazy search over the internet, the only answer that I found was to insert some code in the notebook cell to restart the kernel but this didn&#39;t work.</p><p>The solution was almost hidden in the Watson Studio documentation and turns out that it is pretty simple (you can find the issue <a href="https://www.ibm.com/docs/en/cloud-paks/cp-data/4.0?topic=issues-watson-studio#jobs-fails-with-lib-change">here</a>). You need to customize your environment so when you create your python notebook the necessary packages are already there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9GLOr7BzJkPkLBNNw37yeg.png" /><figcaption>Problem is a known issue</figcaption></figure><p>So in the following I will show how you can customize your environment in Watson Studio.</p><p>The first thing to do is go in environments under management and create a new template.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tms8-hTca5bxHyi1rEu7Tg.jpeg" /><figcaption>Manage the environments in Watson Studio</figcaption></figure><p>After that create a new environment and give a name, a description and choose the configuration as language and hardware.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xrdfx3Ex28Q0X2jAE0ZruA.jpeg" /><figcaption>Seting for new enviroment</figcaption></figure><p>With the new environment set choose your new environment in the list and edit it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cJbDOVRHfkeBnGyGfdCX1Q.jpeg" /><figcaption>Options for the enviroment</figcaption></figure><p>In the edit mode go to Costomization and it will open a space for you to add your packages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0dRv5qEPwJxwte0y9jrhRw.jpeg" /><figcaption>Customization window</figcaption></figure><p>In the customization part you show first add nodefaults with defaults in conda packages since it you need more than on repository. You can add URLs and connect with other repositories in case you are using more complex packages. In my case since packages are from TensorFlow these will be enough.</p><p>Since for my package I need last version of TensorFlow I add it bellow pip dependencies packages to get an update.</p><p>In the last part I add the names of the packages that I need to be added.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1MF-rMiBAcetXY_a-JEn9w.jpeg" /><figcaption>Adding TensorFlow packages to customize environment.</figcaption></figure><p>After add your packages you just need to create you notebook and choose the new environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bXZgM1kqbSlVZHT0RnkpXw.jpeg" /><figcaption>Create a new notebook with a customized enviroment</figcaption></figure><p>In the new notebook with customized environment just import your packages and will be loaded without you need to restart the kernel!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7vOPMLMe4gVXGB0_4v50jg.jpeg" /><figcaption>New notebook with the new environment and packages instanced.</figcaption></figure><p>In case that you have a more complex package to add I point you for the documentation of customize environment <a href="https://www.ibm.com/docs/en/cloud-paks/cp-data/4.0?topic=environments-creating">here</a>.</p><p>Hope this post will help you!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67ce94e68d9d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>