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.

Some model can't be download automatically

See original GitHub issue

Describe the bug I’m using the minimal example from readme, and change it to parse chinese:

But upon running, it errors:

OSError: Unable to load weights from pytorch checkpoint file. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True.

While bert-base-cased can run without any error.

To Reproduce Steps to reproduce the behavior:

from simpletransformers.classification import ClassificationModel
import pandas as pd


# Train and Evaluation data needs to be in a Pandas Dataframe of two columns. The first column is the text with type str, and the second column is the label with type int.
train_data = [['属于类一的例句', 1], ['属于类二的例句', 0]]
train_df = pd.DataFrame(train_data)

eval_data = [['属于类一的例句2', 1], ['属于类二的例句1', 0]]
eval_df = pd.DataFrame(eval_data)

# Create a ClassificationModel
model = ClassificationModel('bert', 'bert-base-chinese', use_cuda=False, args={'overwrite_output_dir': True}) # You can set class weights by using the optional weight argument

# Train the model
model.train_model(train_df)

# Evaluate the model
result, model_outputs, wrong_predictions = model.eval_model(eval_df)

Expected behavior Run as example in readme.

Screenshots 截屏2020-01-19下午11 02 29

Desktop (please complete the following information):

  • MacOS 10.15.2

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
linonetwocommented, Jan 21, 2020

Thank you, I can confirm it works!

0reactions
ThilinaRajapaksecommented, Jan 21, 2020

image

It’s working for me. It’s possible that there is a corrupted model saved on your system. Try this:

# Create a ClassificationModel
model = ClassificationModel(
    "bert", "bert-base-chinese", use_cuda=False, args={"overwrite_output_dir": True}, force_download=True
)  # You can set class weights by using the optional weight argument
Read more comments on GitHub >

github_iconTop Results From Across the Web

Allow or Block Automatic File Downloads for Apps in Windows ...
Allow or Block Automatic File Downloads for Apps in Windows 10 [Tutorial].When you use an online ... Your browser can't play this video....
Read more >
Fix file download errors - Google Chrome Help
This error means that there's not enough space on your computer to download the file. To fix the error: Delete some files from...
Read more >
Automatic file download notifications in Windows 10
Tip: Don't want notifications for automatic file downloads? Select the Start button, then select Settings > System > Notifications & actions , and...
Read more >
Downloading 3D models - Sketchfab Help Center
Every Sketchfab user has the ability to download select 3D models. You can specifically search for downloadable models (by toggling...
Read more >
How to Fix Images Not Downloading Automatically in Outlook
If you're using Outlook 2007, go to Tools > Trust Center > Automatic Download and then uncheck “Don't download pictures automatically in HTML...
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