question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Import Error: Cannot load backend 'TkAgg' which requires the 'tk' interactive framework, as 'headless' is currently running

See original GitHub issue

I’m facing import error while executing the ludwig from google colab… !!

Below is the code which I executed in steps:

  1. Loading Ludwig !pip install ludwig

  2. Upload file from local to Drive - to use in Colab from google.colab import files uploaded = files.upload()

  3. Train DataSet using ludwig cmd !ludwig train --data_csv ludwig_traindataset_1.csv --model_definition_file model_def.yaml

My model_def.yaml

input_features:
  - name: utterance
    type: sequence
    encoder: rnn
    cell_type: lstm
    bidirectional: true
    num_layers: 2
    reduce_output: None

output_features:
  - name: intent
    type: category
    reduce_input: sum
    num_fc_layers: 1
    fc_size: 64
  - name: slots
    type: sequence
    decoder: tagger

Dummy Dataset:

image

Attached the screenshot error:

image

Can anyone help me on this in Google Colab GPU / Python 3.6

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:9
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

10reactions
w4nderlustcommented, Feb 13, 2019

Yes I will update to version 0.1.1 once enough bugs are fixed. In the mean time can you please try with pip install https://github.com/uber/ludwig/archive/master.zip which should install the current code in the master branch?

3reactions
w4nderlustcommented, Feb 12, 2019

So it turns out mpl.use('TKAgg') was needed to render windows in Mac OS X in older versions of matplotlib. I removed it and increased the matplotlib version in the requirements. Please confirm this solves the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ImportError: Cannot load backend 'TkAgg' which requires the ...
I have tried to reinstall matplotlib in several ways, and install tk-dev, all of them don't work. import matplotlib import glob **matplotlib.use ...
Read more >
Cannot load backend 'TkAgg' which requires the 'tk' interactive ...
ImportError: Cannot load backend 'TkAgg' which requires the 'tk' interactive framework, as 'headless' is currently running #415.
Read more >
Cannot load backend 'TkAgg' which requires the 'tk' interactive ...
Coding example for the question ImportError: Cannot load backend 'TkAgg' which requires the 'tk' interactive framework, as 'headless' is currently running.
Read more >
Ssh x11 forwarding - Cannot load backend 'TkAgg' which ...
Ssh x11 forwarding - Cannot load backend 'TkAgg' which requires the 'tk' interactive framework, as 'headless' is currently running.
Read more >
how to turn off "headless" mode? : r/bashonubuntuonwindows
... ImportError( ImportError: Cannot load backend 'TkAgg' which requires the 'tk' interactive framework, as 'headless' is currently running`.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found