# Train-curve ends in error (module 'plotext' has no attribute 'colorless')

**URL:** <https://support.prodi.gy/t/train-curve-ends-in-error-module-plotext-has-no-attribute-colorless/5611>\
**Category:** Uncategorized\
**Tags:** usage\
**Created:** [May 4, 2022, 10:40pm UTC](https://support.prodi.gy/t/train-curve-ends-in-error-module-plotext-has-no-attribute-colorless/5611 "2022-05-04T22:40:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dave-espinosa](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/dave-espinosa/32/2628_2.png) [@dave-espinosa](https://support.prodi.gy/u/dave-espinosa)\
**Post date:** [May 4, 2022, 10:40pm UTC](https://support.prodi.gy/t/train-curve-ends-in-error-module-plotext-has-no-attribute-colorless/5611/1 "2022-05-04T22:40:50Z")

</div>

Hello everyone.

I was using [train-curve](https://prodi.gy/docs/recipes#train-curve), with the following results:

```python
=========================== Train curve diagnostic ===========================
Training 5 times with 20%, 40%, 60%, 80%, 100% of the data

% Score ner   
---- ------ ------
  0% 0.00 0.00  
 20% 0.38 ▲ 0.38 ▲
 40% 0.42 ▲ 0.42 ▲
 60% 0.45 ▲ 0.45 ▲
 80% 0.47 ▲ 0.47 ▲
100% 0.46 ▼ 0.46 ▼

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.8/dist-packages/prodigy/ __main__.py", line 61, in <module>
    controller = recipe(*args, use_plac=True)
  File "cython_src/prodigy/core.pyx", line 329, in prodigy.core.recipe.recipe_decorator.recipe_proxy
  File "/usr/local/lib/python3.8/dist-packages/plac_core.py", line 367, in call
    cmd, result = parser.consume(arglist)
  File "/usr/local/lib/python3.8/dist-packages/plac_core.py", line 232, in consume
    return cmd, self.func(*(args + varargs + extraopts), **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/prodigy/recipes/train.py", line 387, in train_curve
    prev_scores = scores
  File "/usr/lib/python3.8/contextlib.py", line 120, in __exit__
    next(self.gen)
  File "cython_src/prodigy/components/printers.pyx", line 75, in train_curve_printer
AttributeError: module 'plotext' has no attribute 'colorless'

```

As you can see, the results table displays normally, just to fail afterwards, during the curve plotting, with the error `AttributeError: module 'plotext' has no attribute 'colorless'`. BTW I am currently using `prodigy==1.11.7` and `plotext==5.0.2`. The only thing I have found in 'plotext' changelog, vaguely related to my issue, is [this one](https://pypi.org/project/plotext/2.2.0/#:~:text=the%20plots%20are%20printed%20with%20a%20default%20color%20combination%2C%20instead%20of%20default%20colorless%20one), but no naming convention change was found (as in [this case](https://support.prodi.gy/t/train-curve-ends-in-error-module-plotext-has-no-attribute-figsize/4590)).

Is there any "`plotext` recommended version"? Other than that, any ideas?

---

<div class="post-metadata">

**Author:** ![ljvmiranda921](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ljvmiranda921/32/3197_2.png) [@ljvmiranda921](https://support.prodi.gy/u/ljvmiranda921)\
**Post date:** [May 5, 2022, 1:56am UTC](https://support.prodi.gy/t/train-curve-ends-in-error-module-plotext-has-no-attribute-colorless/5611/2 "2022-05-05T01:56:24Z")

</div>

Hi @dave-espinosa ,

Can you try installing `plotext==4.2.0`? It seems that `plotext` released a major version a few days ago and removed the `colorless` parameter and [replaced it with `clear_color`](https://github.com/piccolomo/plotext/blob/3265d34ac3ae932d7b86398b2946fd33fd7365f2/readme/notes.md#main-updates). Thanks for reporting this too!

---

<div class="post-metadata">

**Author:** ![dave-espinosa](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/dave-espinosa/32/2628_2.png) [@dave-espinosa](https://support.prodi.gy/u/dave-espinosa)\
**Post date:** [May 5, 2022, 9:25pm UTC](https://support.prodi.gy/t/train-curve-ends-in-error-module-plotext-has-no-attribute-colorless/5611/3 "2022-05-05T21:25:34Z")

</div>

Hello @ljvmiranda921 ,

I have downgraded to `plotext==4.2.0`, and I am now getting the desired graph:

```python
=========================== Train curve diagnostic ===========================
Training 2 times with 50%, 100% of the data

% Score ner   
---- ------ ------
  0% 0.01 0.01  
 50% 0.48 ▲ 0.48 ▲
100% 0.54 ▲ 0.54 ▲

    ┌──────────────────────────────────┐
0.54┤ ▗▄▄▄▄▄▄▄▞▀▀▀▀│
0.48┤ ▗▞▀▀▀▀▘ │
    │ ▗▞▘ │
    │ ▄▀▘ │
    │ ▗▄▀ │
    │ ▗▞▘ │
    │ ▄▞▘ │
    │ ▄▀ │
0.01┤▄▀ │
    └┬────────────────┬───────────────┬┘
     0% 50% 100% 

✔ Accuracy improved in the last sample
As a rule of thumb, if accuracy increases in the last segment, this could
indicate that collecting more annotations of the same type will improve the
model further.

```

Therefore, **the containment solution works**.

I am curious now: **Is prodigy "automatically" updated or not, by any chance?**

The reason I am asking this, is because if it is not, then I think we can keep working with this containment; however if it is, then of course we might need to upgrade `plotext` once this issue appears again.

Let me know your comments please.

Thank you!

---

<div class="post-metadata">

**Author:** ![ljvmiranda921](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ljvmiranda921/32/3197_2.png) [@ljvmiranda921](https://support.prodi.gy/u/ljvmiranda921)\
**Post date:** [May 6, 2022, 12:35am UTC](https://support.prodi.gy/t/train-curve-ends-in-error-module-plotext-has-no-attribute-colorless/5611/4 "2022-05-06T00:35:33Z")

</div>

Hi @dave-espinosa , similar to any Python dependency, you have to update Prodigy via `pip`. For now, if you have a project that uses `train-curve`, you can pin the `plotext` dependency in your `requirements.txt` file

```python
# requirements.txt
prodigy
plotext==4.2.0

```

I think pinning some dependencies is actually a good practice to maintain the same environment all throughout. Especially given that third-party dependencies tend to update and be "out-of-sync" with one another.

---

<div class="post-metadata">

**Author:** ![dave-espinosa](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/dave-espinosa/32/2628_2.png) [@dave-espinosa](https://support.prodi.gy/u/dave-espinosa)\
**Post date:** [May 6, 2022, 4:55pm UTC](https://support.prodi.gy/t/train-curve-ends-in-error-module-plotext-has-no-attribute-colorless/5611/5 "2022-05-06T16:55:49Z")

</div>

Hello @ljvmiranda921 ,

Thank you very much for your guidance and recommendations.

From my side, please consider the case closed.

---

<div class="post-metadata">

**Author:** ![EmreSevinc](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/emresevinc/32/3354_2.png) [@EmreSevinc](https://support.prodi.gy/u/EmreSevinc)\
**Post date:** [November 17, 2022, 3:10pm UTC](https://support.prodi.gy/t/train-curve-ends-in-error-module-plotext-has-no-attribute-colorless/5611/6 "2022-11-17T15:10:30Z")

</div>

I hit the same error and was about to start a new thread, but thanks to suggestions, saw this one, which solved my problem. So, thanks a lot! @dave-espinosa and @ljvmiranda921! 🙂
