Trying to train a BERT model, I keep getting a tensorflow type error - bert-language-model

TypeError: Expected string passed to parameter 'y' of op 'NotEqual', got -100 of type 'int' instead. Error: Expected string, but got -100 of type 'int'.

Related

Using make.link in a layer_lambda

I am trying to pass an inverse link function to a keras::layer_lambda layer in a keras functional model. The layer is inside a function where "link" is a parameter:
link_layer <- spatial_summing_layer %>%
keras::layer_lambda(stats::make.link(link)$linkinv,
name = "link_layer")
It works fine for "identity", "sqrt", "1/mu^2" and "inverse" (all do not use .Machine$double.eps), but when I try to use a different link ("log"), I get the following error:
Error in py_call_impl(callable, dots$args, dots$keywords) :
RuntimeError: Exception encountered when calling layer "link_layer" (type Lambda).
Evaluation error: missing value where TRUE/FALSE needed.
Call arguments received by layer "link_layer" (type Lambda):
• inputs=tf.Tensor(shape=(None, 867, 1), dtype=float32)
• mask=None
• training=None
I believe it must be something to do with the environments, but I have no idea how to resolve it, except for manually coding the link functions myself.

MethodError: Cannot `convert` an object of type Array{Float64,1} to an object of type SentinelArrays.ChainedVector{Float64,Array{Float64,1}}

I ran the following loop:
for k in N
Load_dict[k] = fill(0.0,8760)
end
and got the error specified in the title.
Type of N is Array{Symbol,1}, load_dict[k] is SentinelArrays.ChainedVector{Float64,Array{Float64,1}} and fill(0.0, 8760) generates arrays of Array{Float64,1}.
Can Array{Float64,1} be converted to SentinelArrays.ChainedVector{Float64,Array{Float64,1}}? Or is there a way to generate SentinelArrays.ChainedVector{Float64,Array{Float64,1}} arrays, directly?
Thanks!
Currently an appropriate convert method is undefined so you need to use a constructor:
Load_dict[k] = ChainedVector([fill(0.0, 8760)])
However, it seems that the eltype of your Load_dict is overly narrow (unless you really know what you are doing and why you need a collection of ChainedVector).

operation between uword and integer in RcppAmadillo

I am submitting an R package to biocondutor, which contains some RcppArmadillo codes. I got some complaints from one platform for the operation between uword and int. In the following, drop_bin(0) is uword and bin_number is an integer. This error happens when I compare the uword with integer. However I don't see errors when I run it in my mac osx at all. Is there any way to get around it? Thanks.
degnormCPP.cpp: In function 'arma::uvec bin_drop(int, int, arma::rowvec)':
degnormCPP.cpp:27:18: warning: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Wsign-compare]
if (drop_bin(0)==bin_number-1){...}
~~~~~~~~~~~^~~~~~~~~~~~~~
degnormCPP.cpp: In function 'Rcpp::List optiNMFCPP(arma::mat, arma::vec, int)':
I guess I found the answer by cast.
if ((int) drop_bin(0)==bin_number-1){...}
bioconductor seems not complaining anymore

Array where there is a non-numeric argument to binary operator

I was running my code, when I received the following error message:
"Error in t-1: non-numeric argument to binary operator"
The error is in p[t]<-p[t-1] in the function:
p<-rep(0, dimension)
price<-function(n, dimension){
p[t]<-p[t-1]
...
}
this function is recalled into another function where p[t=0] is equal to 1. T represents the time at which an order is submitted. At the beginning, i.e. for t=0, p[t]<-1. I also tried to change p[t-1] into p[t] and p[t] into p[t+1], but it gives me the same error.
Could you please tell me how I can fix this error?
Thank you

How to create an object like `()` in user space

In Julia the empty tuple is both a type and an instance of that type. So isa((),()) is true. Is it possible to create a similar object myself?
I don't believe so. In fact, in Julia 0.4 isa((),()) is no longer true. The type of () is now Tuple{}:
julia> VERSION
v"0.4.0-dev+5441"
julia> typeof(())
Tuple{}
julia> isa((),()) # Throws an error since () is no longer considered a Type
ERROR: TypeError: isa: expected Type{T}, got Tuple{}
I think the only remaining objects that are an instance of themselves are Any, Type and DataType.

Resources