Comments (16)
你是怎么运行的,加载的模型是哪个
from pytorch_bert_bilstm_crf_ner.
你是怎么运行的,加载的模型是哪个
我是在pycharm里打开工程文件夹,然后在命令行输入了你给的这个运行命令,lstm和crf都设置的true
预训练模型的话就用的bert base chinese,放在了新建的同级目录model_hub/bert-base-chinese/下
同时也下载了百度网盘的这四个模型文件,放在了checkpoints下面
from pytorch_bert_bilstm_crf_ner.
我加你qq吧,你说下。
from pytorch_bert_bilstm_crf_ner.
我加你qq吧,你说下。
2446642294
from pytorch_bert_bilstm_crf_ner.
[--eval_batch_size EVAL_BATCH_SIZE] [--swa_start SWA_START] [--train_epochs TRAIN_EPOCHS] [--dropout_prob DROPOUT_PROB] [--lr LR] [--other_lr OTHER_LR] [--crf_lr CRF_LR]
[--max_grad_norm MAX_GRAD_NORM] [--warmup_proportion WARMUP_PROPORTION] [--weight_decay WEIGHT_DECAY] [--adam_epsilon ADAM_EPSILON] [--train_batch_size TRAIN_BATCH_SIZE] [--use_lstm USE_LSTM]
[--lstm_hidden LSTM_HIDDEN] [--num_layers NUM_LAYERS] [--dropout DROPOUT] [--use_crf USE_CRF]
main.py: error: unrecognized arguments:
./main.sh: 行 2: --bert_dir: 未找到命令
./main.sh: 行 3: --data_dir: 未找到命令
./main.sh: 行 4: --log_dir: 未找到命令
./main.sh: 行 5: --output_dir: 未找到命令
./main.sh: 行 6: --num_tags: 未找到命令
./main.sh: 行 7: --seed: 未找到命令
./main.sh: 行 8: --gpu_ids: 未找到命令
./main.sh: 行 9: --max_seq_len: 未找到命令
./main.sh: 行 10: --lr: 未找到命令
./main.sh: 行 11: --crf_lr: 未找到命令
./main.sh: 行 12: --other_lr: 未找到命令
./main.sh: 行 13: --train_batch_size: 未找到命令
./main.sh: 行 14: --train_epochs: 未找到命令
./main.sh: 行 15: --eval_batch_size: 未找到命令
./main.sh: 行 16: --max_grad_norm: 未找到命令
./main.sh: 行 17: --warmup_proportion: 未找到命令
./main.sh: 行 18: --adam_epsilon: 未找到命令
./main.sh: 行 19: --weight_decay: 未找到命令
./main.sh: 行 20: --lstm_hidden: 未找到命令
./main.sh: 行 21: --num_layers: 未找到命令
./main.sh: 行 22: --use_lstm: 未找到命令
./main.sh: 行 23: --use_crf: 未找到命令
./main.sh: 行 24: --dropout_prob: 未找到命令
./main.sh: 行 25: --dropout: 未找到命令
请问这是什么情况呢 运行main.sh跑不起来
from pytorch_bert_bilstm_crf_ner.
[--eval_batch_size EVAL_BATCH_SIZE] [--swa_start SWA_START] [--train_epochs TRAIN_EPOCHS] [--dropout_prob DROPOUT_PROB] [--lr LR] [--other_lr OTHER_LR] [--crf_lr CRF_LR] [--max_grad_norm MAX_GRAD_NORM] [--warmup_proportion WARMUP_PROPORTION] [--weight_decay WEIGHT_DECAY] [--adam_epsilon ADAM_EPSILON] [--train_batch_size TRAIN_BATCH_SIZE] [--use_lstm USE_LSTM] [--lstm_hidden LSTM_HIDDEN] [--num_layers NUM_LAYERS] [--dropout DROPOUT] [--use_crf USE_CRF]
main.py: error: unrecognized arguments:
./main.sh: 行 2: --bert_dir: 未找到命令
./main.sh: 行 3: --data_dir: 未找到命令
./main.sh: 行 4: --log_dir: 未找到命令
./main.sh: 行 5: --output_dir: 未找到命令
./main.sh: 行 6: --num_tags: 未找到命令
./main.sh: 行 7: --seed: 未找到命令
./main.sh: 行 8: --gpu_ids: 未找到命令
./main.sh: 行 9: --max_seq_len: 未找到命令
./main.sh: 行 10: --lr: 未找到命令
./main.sh: 行 11: --crf_lr: 未找到命令
./main.sh: 行 12: --other_lr: 未找到命令
./main.sh: 行 13: --train_batch_size: 未找到命令
./main.sh: 行 14: --train_epochs: 未找到命令
./main.sh: 行 15: --eval_batch_size: 未找到命令
./main.sh: 行 16: --max_grad_norm: 未找到命令
./main.sh: 行 17: --warmup_proportion: 未找到命令
./main.sh: 行 18: --adam_epsilon: 未找到命令
./main.sh: 行 19: --weight_decay: 未找到命令
./main.sh: 行 20: --lstm_hidden: 未找到命令
./main.sh: 行 21: --num_layers: 未找到命令
./main.sh: 行 22: --use_lstm: 未找到命令
./main.sh: 行 23: --use_crf: 未找到命令
./main.sh: 行 24: --dropout_prob: 未找到命令
./main.sh: 行 25: --dropout: 未找到命令
请问这是什么情况呢 运行main.sh跑不起来
可能是windows和linux换行的问题,你去掉\,都在一行输入看看。
from pytorch_bert_bilstm_crf_ner.
[--eval_batch_size EVAL_BATCH_SIZE] [--swa_start SWA_START] [--train_epochs TRAIN_EPOCHS] [--dropout_prob DROPOUT_PROB] [--lr LR] [--other_lr OTHER_LR] [--crf_lr CRF_LR] [--max_grad_norm MAX_GRAD_NORM] [--warmup_proportion WARMUP_PROPORTION] [--weight_decay WEIGHT_DECAY] [--adam_epsilon ADAM_EPSILON] [--train_batch_size TRAIN_BATCH_SIZE] [--use_lstm USE_LSTM] [--lstm_hidden LSTM_HIDDEN] [--num_layers NUM_LAYERS] [--dropout DROPOUT] [--use_crf USE_CRF]
main.py: error: unrecognized arguments:
./main.sh: 行 2: --bert_dir: 未找到命令
./main.sh: 行 3: --data_dir: 未找到命令
./main.sh: 行 4: --log_dir: 未找到命令
./main.sh: 行 5: --output_dir: 未找到命令
./main.sh: 行 6: --num_tags: 未找到命令
./main.sh: 行 7: --seed: 未找到命令
./main.sh: 行 8: --gpu_ids: 未找到命令
./main.sh: 行 9: --max_seq_len: 未找到命令
./main.sh: 行 10: --lr: 未找到命令
./main.sh: 行 11: --crf_lr: 未找到命令
./main.sh: 行 12: --other_lr: 未找到命令
./main.sh: 行 13: --train_batch_size: 未找到命令
./main.sh: 行 14: --train_epochs: 未找到命令
./main.sh: 行 15: --eval_batch_size: 未找到命令
./main.sh: 行 16: --max_grad_norm: 未找到命令
./main.sh: 行 17: --warmup_proportion: 未找到命令
./main.sh: 行 18: --adam_epsilon: 未找到命令
./main.sh: 行 19: --weight_decay: 未找到命令
./main.sh: 行 20: --lstm_hidden: 未找到命令
./main.sh: 行 21: --num_layers: 未找到命令
./main.sh: 行 22: --use_lstm: 未找到命令
./main.sh: 行 23: --use_crf: 未找到命令
./main.sh: 行 24: --dropout_prob: 未找到命令
./main.sh: 行 25: --dropout: 未找到命令
请问这是什么情况呢 运行main.sh跑不起来可能是windows和linux换行的问题,你去掉\,都在一行输入看看。
okk 已经解决!另外需要去掉等号 感谢楼主!
from pytorch_bert_bilstm_crf_ner.
``FileNotFoundError: [Errno 2] No such file or directory: './checkpoints/bert_bilstm_crf/model.pt'
老哥我一直报这个错
from pytorch_bert_bilstm_crf_ner.
``FileNotFoundError: [Errno 2] No such file or directory: './checkpoints/bert_bilstm_crf/model.pt'
老哥我一直报这个错
把相关文件的路径换成绝对路径试试。同时要注意windows和linux的区别。
from pytorch_bert_bilstm_crf_ner.
``FileNotFoundError: [Errno 2] No such file or directory: './checkpoints/bert_bilstm_crf/model.pt'
老哥我一直在报这个错把相关文件的路径提示绝对路径聪明。同时要注意windows和linux的区别。
from pytorch_bert_bilstm_crf_ner.
``FileNotFoundError: [Errno 2] No such file or directory: './checkpoints/bert_bilstm_crf/model.pt'
老哥我一直在报这个错把相关文件的路径提示绝对路径聪明。同时要注意windows和linux的区别。
我是想自己训练一下模型,这个位置不应该是训练完保存模型的位置吗,现在checkpionts文件是空的,找不到是正常的,我在想为啥没有训练,
from pytorch_bert_bilstm_crf_ner.
``FileNotFoundError: [Errno 2] No such file or directory: './checkpoints/bert_bilstm_crf/model.pt'
老哥我一直在报这个错把相关文件的路径提示绝对路径聪明。同时要注意windows和linux的区别。
我是想自己训练一下模型,这个位置不应该是训练完保存模型的位置吗,现在checkpionts文件是空的,找不到是正常的,我在想为啥没有训练,
main.py里面有训练、验证、测试和预测的代码,有可能是被注释掉了,自己根据相关需要打开注释的代码就行了。
from pytorch_bert_bilstm_crf_ner.
``FileNotFoundError: [Errno 2] No such file or directory: './checkpoints/bert_bilstm_crf/model.pt'
老哥我一直在报这个错把相关文件的路径提示绝对路径聪明。同时要注意windows和linux的区别。
我是想自己训练一下模型,这个位置不应该是训练完保存模型的位置吗,现在checkpionts文件是空的,找不到是正常的,我在想为啥没有训练,
main.py里面有训练、验证、测试和预测的代码,有可能是被注释掉了,自己根据相关需要打开注释的代码就行了。
bertForNer.train()
我把这个注释打开以后
RuntimeError: stack expects a non-empty TensorList
说我数据没有传进去
from pytorch_bert_bilstm_crf_ner.
``FileNotFoundError: [Errno 2] No such file or directory: './checkpoints/bert_bilstm_crf/model.pt'
老哥我一直在报这个错把相关文件的路径提示绝对路径聪明。同时要注意windows和linux的区别。
我是想自己训练一下模型,这个位置不应该是训练完保存模型的位置吗,现在checkpionts文件是空的,找不到是正常的,我在想为啥没有训练,
main.py里面有训练、验证、测试和预测的代码,有可能是被注释掉了,自己根据相关需要打开注释的代码就行了。
bertForNer.train()
我把这个注释打开以后
RuntimeError: stack expects a non-empty TensorList
说我数据没有传进去
我在您公众号上给您发消息了,您看到回一下
from pytorch_bert_bilstm_crf_ner.
你好,我单独使用bert模型,没有加LSTM和CRF,在main.py中运行 bertForNer.predict(raw_text, model_path)
报出错误,RuntimeError: Boolean value of Tensor with more than one value is ambiguous
然后我定位到decodeUtils.py中的方法 bioes_decode(decode_tokens, raw_text, id2ent)
中的 if decode_tokens[index_] == 0:
这一行
传入的 decode_tokens
是一个张量,可以直接判断是否等于0吗?
不知道怎么解决了,希望博主能帮忙下
from pytorch_bert_bilstm_crf_ner.
你好,我单独使用bert模型,没有加LSTM和CRF,在main.py中运行
bertForNer.predict(raw_text, model_path)
报出错误,RuntimeError: Boolean value of Tensor with more than one value is ambiguous
然后我定位到decodeUtils.py中的方法bioes_decode(decode_tokens, raw_text, id2ent)
中的if decode_tokens[index_] == 0:
这一行 传入的decode_tokens
是一个张量,可以直接判断是否等于0吗? 不知道怎么解决了,希望博主能帮忙下
decode_tokens应该是一个一维数组,比如[0,1,2,2,3,0,0],自己打印下看怎么转换成这样。
from pytorch_bert_bilstm_crf_ner.
Related Issues (20)
- 大哥你好。我想问一下File "/home/vrlab/wwt/pytorch_bert_bilstm_crf_ner-main/bert_base_model.py", line 11, in __init__ assert os.path.exists(bert_dir) and os.path.exists(config_path), \ AssertionError: pretrained bert file does not exist是为啥 HOT 5
- 运行问题 HOT 6
- 您好 HOT 9
- 大佬您好,可以帮忙看看这个bug吗 HOT 13
- 换成BIO类型的数据应该怎么做? HOT 7
- 导出onnx问题 Error(s) in loading state_dict for BertNerModel: Unexpected key(s) in state_dict: "linear.weight", "linear.bias". HOT 2
- 对BERT模型进行继续预训练对提高性能是否有帮助? HOT 4
- 训练自己的数据,内存占用一直增长,直到吃满内存 HOT 2
- 请问一小pkl文件怎么处理得到? HOT 1
- > 我加你qq吧,你说下。 HOT 2
- 关于使用CRF文件将BERT+CRF模型转换为ONNX的问题 HOT 6
- 网页问题 HOT 1
- 英文实体识别的问题 HOT 1
- RuntimeError: expected predicate to be bool, got torch.uint8 HOT 1
- Albert问题 HOT 2
- AssertionError: pretrained bert file does not exist HOT 1
- 更换数据集后报CUDA error: device-side assert triggered HOT 1
- 求一份分词数据集 HOT 1
- 我的checkpoints文件夹是空的 HOT 1
- 这个命名实体识别的算法思路是什么? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch_bert_bilstm_crf_ner.