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.

i am getting can not import name 'model_train'

See original GitHub issue
C:\Users\Dell\Desktop\text-detection-ctpn-banjin-dev\main>demo.py
Traceback (most recent call last):
  File "C:\Users\Dell\Desktop\text-detection-ctpn-banjin-dev\main\demo.py", line 13, in <module>
    from nets import model_train as model
ImportError: cannot import name 'model_train'

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

6reactions
jasoriyacommented, Jul 26, 2019

So after facing the same error, I figured out what was being done wrong. The problem is due to the fact that you are running demo.py from the main folder. Python tries to find model_train.py in the tensorflow/models/research/slim PATH.

There is a folder named nets in text-detection-ctpn folder which contains model_train.py. So the correct way of running the program is from text-detection-ctpn folder as stated in the Readme.

Just run -> python ./main/demo.py

6reactions
nomana-hitotorocommented, Jul 23, 2019

@sinny777 I resolved this error, just play a bit with file location and you could be able to solve this. I’m sorry, I’m not able to provide you a more precise answer x’)

Read more comments on GitHub >

github_iconTop Results From Across the Web

ImportError: cannot import name convert_all_kernels_in_model
python.keras imports with tensorflow.keras in ImageAI library. After this, from imageai.Prediction.Custom import ModelTraining import works fine ...
Read more >
ImportError: cannot import name convert_all_kernels_in_model
I am trying to use ImageAI's model training to train an AI model. This is the code: from imageai.Prediction.Custom import ModelTraining model_trainer ...
Read more >
ImportError cannot import name train test split from sklearn ...
I am trying to use train_test_split module, but it shows me the bellow error. $ from sklearn.linear_model import train_test_split ImportError ...
Read more >
import "tensorflow.keras" could not be resolved - You.com
Hi, I am trying to use image augmentation and getting this issue. Although codes are running, data is not being augmented. Do you...
Read more >
Source code for torchvision.models.feature_extraction - PyTorch
The resulting graph ends up having single nodes referencing calls to the leaf modules' forward ... Module, module_qualname: str) -> bool: if isinstance(m, ......
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