Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
627b3280
提交
627b3280
authored
7月 04, 2017
作者:
João Victor Tozatti Risso
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve error messages in CPU CTC wrapper
Signed-off-by:
João Victor Tozatti Risso
<
joaovictor.risso@gmail.com
>
上级
8199e8ce
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
9 行增加
和
9 行删除
+9
-9
ctc_wrapper.c
theano/tensor/nnet/ctc_wrapper.c
+9
-9
没有找到文件。
theano/tensor/nnet/ctc_wrapper.c
浏览文件 @
627b3280
...
@@ -43,7 +43,7 @@ int ctc_check_result(ctcStatus_t retcode, const char * msg)
...
@@ -43,7 +43,7 @@ int ctc_check_result(ctcStatus_t retcode, const char * msg)
const
char
*
ctc_msg
=
ctcGetStatusString
(
retcode
);
const
char
*
ctc_msg
=
ctcGetStatusString
(
retcode
);
PyErr_Format
(
PyExc_RuntimeError
,
PyErr_Format
(
PyExc_RuntimeError
,
"
%s | CTC library error message
: %s"
,
"
ConnectionistTemporalClassification: %s CTC error
: %s"
,
msg
,
msg
,
ctc_msg
);
ctc_msg
);
return
1
;
return
1
;
...
@@ -117,7 +117,7 @@ int APPLY_SPECIFIC(ctc_cost_cpu)(PyArrayObject * in_activations,
...
@@ -117,7 +117,7 @@ int APPLY_SPECIFIC(ctc_cost_cpu)(PyArrayObject * in_activations,
if
(
!
PyArray_IS_C_CONTIGUOUS
(
in_activations
)
)
if
(
!
PyArray_IS_C_CONTIGUOUS
(
in_activations
)
)
{
{
PyErr_SetString
(
PyExc_RuntimeError
,
PyErr_SetString
(
PyExc_RuntimeError
,
"activations array must be C-contiguous."
);
"
ConnectionistTemporalClassification:
activations array must be C-contiguous."
);
return
1
;
return
1
;
}
}
...
@@ -128,7 +128,7 @@ int APPLY_SPECIFIC(ctc_cost_cpu)(PyArrayObject * in_activations,
...
@@ -128,7 +128,7 @@ int APPLY_SPECIFIC(ctc_cost_cpu)(PyArrayObject * in_activations,
if
(
NULL
==
context
->
input_lengths
)
if
(
NULL
==
context
->
input_lengths
)
{
{
PyErr_Format
(
PyExc_MemoryError
,
PyErr_Format
(
PyExc_MemoryError
,
"Co
uld not allocate storage
for input lengths"
);
"Co
nnectionistTemporalClassification: Could not allocate memory
for input lengths"
);
return
1
;
return
1
;
}
}
...
@@ -141,7 +141,7 @@ int APPLY_SPECIFIC(ctc_cost_cpu)(PyArrayObject * in_activations,
...
@@ -141,7 +141,7 @@ int APPLY_SPECIFIC(ctc_cost_cpu)(PyArrayObject * in_activations,
ctc_context_destroy
(
context
);
ctc_context_destroy
(
context
);
PyErr_Format
(
PyExc_MemoryError
,
PyErr_Format
(
PyExc_MemoryError
,
"Co
uld not allocate storage
for labels and their lengths"
);
"Co
nnectionistTemporalClassification: Could not allocate memory
for labels and their lengths"
);
return
1
;
return
1
;
}
}
...
@@ -165,7 +165,7 @@ int APPLY_SPECIFIC(ctc_cost_cpu)(PyArrayObject * in_activations,
...
@@ -165,7 +165,7 @@ int APPLY_SPECIFIC(ctc_cost_cpu)(PyArrayObject * in_activations,
ctc_context_destroy
(
context
);
ctc_context_destroy
(
context
);
PyErr_Format
(
PyExc_MemoryError
,
PyErr_Format
(
PyExc_MemoryError
,
"Co
uld not allocate storage
for CTC costs"
);
"Co
nnectionistTemporalClassification: Could not allocate memory
for CTC costs"
);
return
1
;
return
1
;
}
}
}
}
...
@@ -195,7 +195,7 @@ int APPLY_SPECIFIC(ctc_cost_cpu)(PyArrayObject * in_activations,
...
@@ -195,7 +195,7 @@ int APPLY_SPECIFIC(ctc_cost_cpu)(PyArrayObject * in_activations,
ctc_context_destroy
(
context
);
ctc_context_destroy
(
context
);
PyErr_Format
(
PyExc_MemoryError
,
PyErr_Format
(
PyExc_MemoryError
,
"Co
uld not allocate storage
for CTC gradients!"
);
"Co
nnectionistTemporalClassification: Could not allocate memory
for CTC gradients!"
);
return
1
;
return
1
;
}
}
}
}
...
@@ -208,7 +208,7 @@ int APPLY_SPECIFIC(ctc_cost_cpu)(PyArrayObject * in_activations,
...
@@ -208,7 +208,7 @@ int APPLY_SPECIFIC(ctc_cost_cpu)(PyArrayObject * in_activations,
ctc_error
=
ctc_check_result
(
get_workspace_size
(
context
->
label_lengths
,
ctc_error
=
ctc_check_result
(
get_workspace_size
(
context
->
label_lengths
,
context
->
input_lengths
,
alphabet_size
,
minibatch_size
,
context
->
options
,
context
->
input_lengths
,
alphabet_size
,
minibatch_size
,
context
->
options
,
&
cpu_workspace_size
),
&
cpu_workspace_size
),
"Failed to obtain CTC workspace size
!
"
);
"Failed to obtain CTC workspace size
.
"
);
if
(
ctc_error
)
// Exception is set by ctc_check_result, return error here
if
(
ctc_error
)
// Exception is set by ctc_check_result, return error here
{
{
...
@@ -226,14 +226,14 @@ int APPLY_SPECIFIC(ctc_cost_cpu)(PyArrayObject * in_activations,
...
@@ -226,14 +226,14 @@ int APPLY_SPECIFIC(ctc_cost_cpu)(PyArrayObject * in_activations,
ctc_context_destroy
(
context
);
ctc_context_destroy
(
context
);
PyErr_Format
(
PyExc_MemoryError
,
PyErr_Format
(
PyExc_MemoryError
,
"
Failed to allocate memory for CTC workspace!
"
);
"
ConnectionistTemporalClassification: Failed to allocate memory for CTC workspace.
"
);
return
1
;
return
1
;
}
}
ctc_error
=
ctc_check_result
(
compute_ctc_loss
(
activations
,
gradients
,
ctc_error
=
ctc_check_result
(
compute_ctc_loss
(
activations
,
gradients
,
context
->
flat_labels
,
context
->
label_lengths
,
context
->
input_lengths
,
context
->
flat_labels
,
context
->
label_lengths
,
context
->
input_lengths
,
alphabet_size
,
minibatch_size
,
costs
,
context
->
workspace
,
alphabet_size
,
minibatch_size
,
costs
,
context
->
workspace
,
context
->
options
),
"Failed to compute CTC loss function
!
"
);
context
->
options
),
"Failed to compute CTC loss function
.
"
);
if
(
ctc_error
)
// Exception is set by ctc_check_result, return error here
if
(
ctc_error
)
// Exception is set by ctc_check_result, return error here
{
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论