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.

Unknown error that didn't arise before in this code

See original GitHub issue

Hi I reinstalled the Kashgari lib, as you said in our previous issue, but! the code, that I didn’t rewrite start to fall down with errors. For example: from kashgari.utils.logger import init_logger init_logger()

from kashgari.tasks.seq_labeling import BLSTMCRFModel from kashgari.embeddings import BERTEmbedding from kashgari.tasks.classification import BLSTMModel `


ModuleNotFoundError Traceback (most recent call last) <ipython-input-2-5618b970895b> in <module> ----> 1 from kashgari.utils.logger import init_logger 2 init_logger() 3 4 from kashgari.tasks.seq_labeling import BLSTMCRFModel 5 from kashgari.embeddings import BERTEmbedding

ModuleNotFoundError: No module named ‘kashgari.utils.logger’; ‘kashgari.utils’ is not a package

But the most weird is that: image

folder = 'multi_cased_L-12_H-768_A-12' `download_url = ‘/home/karina/bert/multi_cased_L-12_H-768_A-12.zip’

print('Unpacking model...') zip_path = '{}.zip'.format(folder) !test -d $folder || (tar xvzf '/home/karina/bert/multi_cased_L-12_H-768_A-12.zip')

config_path = folder+'/bert_config.json' checkpoint_path = folder+'/bert_model.ckpt' vocab_path = folder+'/vocab.txt'

Unpacking model…

from kashgari.embeddings import BERTEmbedding #embedding = BERTEmbedding('rubert_cased_L-12_H-768_A-12_v1', 200) embedding = BERTEmbedding('multi_cased_L-12_H-768_A-12', 200)


ValueError Traceback (most recent call last) <ipython-input-48-0fecd0409dd5> in <module> 1 from kashgari.embeddings import BERTEmbedding 2 #embedding = BERTEmbedding(‘rubert_cased_L-12_H-768_A-12_v1’, 200) ----> 3 embedding = BERTEmbedding(‘multi_cased_L-12_H-768_A-12’, 200)

/usr/local/lib/python3.7/site-packages/kashgari/embeddings/bert_embedding.py in init(self, model_folder, layer_nums, trainable, task, sequence_length, processor, from_saved_model) 71 embedding_size=0, 72 processor=processor, —> 73 from_saved_model=from_saved_model) 74 75 self.processor.token_pad = ‘[PAD]’

/usr/local/lib/python3.7/site-packages/kashgari/embeddings/base_embedding.py in init(self, task, sequence_length, embedding_size, processor, from_saved_model) 75 self.processor = LabelingProcessor() 76 else: —> 77 raise ValueError() 78 else: 79 self.processor = processor

ValueError:

Can you advise me something about that?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
BrikerMancommented, Jul 12, 2019

For your second question. It is because there is a small typo at your code.

# here is a comma at the end, this will make layer_lstm a tuple, not a object
layer_lstm = L.LSTM(**config['layer_lstm']),

# change it to will fix
layer_lstm = L.LSTM(**config['layer_lstm'])
1reaction
BrikerMancommented, Jul 12, 2019

kashgari-tf no longer provide the init_logger function. Remove that line and add your own logger for logs will fix this issue.

import logging
logging.basicConfig(level='DEBUG')
Read more comments on GitHub >

github_iconTop Results From Across the Web

macos - How to Fix iTunes Error -45076 - Ask Different
Here's how to fix error -45076 if you have downgraded iTunes 12.7 to 12.6.2 still under Sierra and have then upgraded your OS...
Read more >
Error 4013: How to Fix it on iPhone, iPad, and iPod Touch
Error 4013 on iPhone, iPad, and iPod appears during restore or update of device. Reasons: Faulty cable, outdated iTunes, outdated macOS or ...
Read more >
Kernel problem, execution stop after ~15min
Hi, I've got a CUDA C/C++ code that launch a kernel with 512threads per blocks ... I run cuda-memcheck and I didn't notice...
Read more >
An error occurred while signing: Unknown error "-2147012894"
An error occurred while signing: Unknown error "-2147012894". The certificate is perfectly valid and not expired and signing manually like ...
Read more >
HX 4.0(2c) Build 35590 Installation fails with unknown error ...
HyperFlex Cluster Deployment will fail with 'Installing Software Packages on Storage Controller VM with Error:unknown error occurred'.
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