小编Agu*_*ina的帖子

重定位 R_X86_64_32S 针对 `.data' 不能在创建共享对象时使用;用 -fPIC 和 gcc 重新编译

当我使用 gcc 编译 print.s 时,出现以下错误:

/usr/bin/ld: /tmp/cc45uyZj.o: relocation R_X86_64_32S against `.data' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)
  1. 我在另一个 linux 发行版中尝试了同样的方法,它运行得很好。

  2. 添加-fPIC没有帮助。apt-get 更新也不行。

  3. 如果你想看代码:https : //github.com/NEGU93/Compilation.git里面的练习 > Part1。当然是文件print.s(顺便说一句。当我做gcc时,所有的.s文件都有类似的错误)。

我想 Kali 发行版中缺少某些东西,但我不知道它可能是什么。

gcc

5
推荐指数
1
解决办法
6434
查看次数

How does tf.gradients manages complex functions?

I am working with complex-valued neural networks.

For Complex-valued neural networks Wirtinger calculus is normally used. The definition of the derivate is then (take into acount that functions are non-Holomorphic because of Liouville's theorem):

维廷格

If you take Akira Hirose book "Complex-Valued Neural Networks: Advances and Applications", Chapter 4 equation 4.9 defines:

截图来自2020-03-03 10-38-21

Where the partial derivative is also calculated using Wirtinger calculus of course.

Is this the case for tensorflow? or is it defined in some other way? I cannot find …

gradient complex-numbers autodiff tensorflow

5
推荐指数
1
解决办法
616
查看次数

AttributeError: 模块“tensorflow”没有属性“assign”

我正在尝试将我以前的 tf1 代码迁移到 tf2。不幸的是,我的代码没有处于急切模式,所以我遇到了更多困难。我执行了以下代码(尚未训练),然后进入错误消息:

Traceback (most recent call last):
    training_op = tf.assign(W, W - learning_rate * gradients)
AttributeError: module 'tensorflow' has no attribute 'assign'
Run Code Online (Sandbox Code Playgroud)

这是我的最小代码示例 PS:它必须处理复数!

# Data pre-processing
    m = 50
    n = 20
    x_train, y_train, x_test, y_test = get_my_data(x, y, m, n) # data x of size mxn

    # Network Declaration
    input_size = n
    output_size = 1
    learning_rate = 0.001  # The optimization learning rate
    # Create weight matrix initialized randomely from N~(0, 0.01)
    W = tf.Variable(tf.complex(np.random.rand(input_size, output_size), …
Run Code Online (Sandbox Code Playgroud)

python tensorflow

4
推荐指数
2
解决办法
5147
查看次数

将大量数据从NIST更改为RIFF WAV文件

因此,我正在编写一个语音识别程序。为此,我从TIMIT下载了400MB的数据。当我准备读取wav文件时(我尝试了两个库),如下所示:

import scipy.io.wavfile as wavfile
import wave

(fs, x) = wavfile.read('../data/TIMIT/TRAIN/DR1/FCJF0/SA1.WAV')
w = wave.open('../data/TIMIT/TRAIN/DR1/FCJF0/SA1.WAV')
Run Code Online (Sandbox Code Playgroud)

在这两种情况下,它们都存在wav文件格式为“ NIST”且必须为“ RIFF”格式的问题。(我也读过有关sph的信息,但是我下载的nist文件是.wav,而不是.sph)。

我从http://sox.sourceforge.net/下载了SOX,然后 将路径正确添加到我的环境变量中,以便我的cmd识别sox。但是我真的找不到如何正确使用它。

我现在需要的是脚本或某种东西,可以使sox将每个wav文件格式从NIST更改为RIFF到某些文件夹和子文件夹下。

编辑:在python中从TIMIT数据库读取WAV文件时,我发现了一个对我有用的响应...运行sph2pipe -f wav input.wav output.wav 我需要的是脚本或在文件夹下搜索的内容,所有包含.wav文件的子文件夹都适用于该行代码。

audio wav sox

3
推荐指数
2
解决办法
919
查看次数

如何通过管道传递到 src 属性 Angular

如果我做:<h2>{{event.role | lowercase}}</h2>src但是,如果我尝试在这样的属性中使用它:

<img src={{event.eventName | lowercase}} alt="">
Run Code Online (Sandbox Code Playgroud)

我收到错误:

core.js:6237 ERROR DOMException: 
Failed to execute 'setAttribute' on 'Element': '|' is not a valid attribute name.
Run Code Online (Sandbox Code Playgroud)

但是,它无法识别管道,无法正确使用管道,因此格式{{event.eventName}}可以正常工作。我该怎么做呢?

angular-pipe angular

2
推荐指数
2
解决办法
2278
查看次数