我正在尝试执行此代码:
import matplotlib.pyplot as plt
import numpy as np
from keras.models import Sequential
from keras.layers import Dense
x = np.linspace(-3, 3, 1000).reshape(-1, 1)
def f(x):
return 2 * x + 5
f = np.vectorize(f)
y = f(x)
def baseline_model():
model = Sequential()
model.add(Dense(1, input_dim=1, activation='linear'))
model.compile(loss='mean_squared_error', optimizer='sgd')
return model
model = baseline_model()
model.fit(x, y, nb_epoch=100, verbose = 0)
Run Code Online (Sandbox Code Playgroud)
但在最后一行它抛出这个错误: ImportError: /home/puck/.theano/compiledir_Linux-4.4--MANJARO-x86_64-with-glibc2.2.5--3.6.0-64/tmpgk36rmkt/mf0c860ada3decf909d2c7248bdfcff39.so: undefined symbol: _ZdlPvm
这是完整的追溯。这是我第一次使用 keras 和 theano,所以我不知道该怎么做。
关于软件版本的一些信息:
Linux 4.4.52-1-MANJARO
GCC 6.3.1
Anaconda 4.3.0
Python 3.6.0
IPython 5.1.0 …Run Code Online (Sandbox Code Playgroud) 我知道使用 systemctl status 检查服务的特定状态并使用 systemctl enable 在系统启动时将服务置于自动启动状态。但是如何列出所有现有的自动启动服务?
这是我的 arch linux 的 grub.cfg 文件的内容。
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ …Run Code Online (Sandbox Code Playgroud) 我有一个锁屏脚本(通过 i3lock),它可以在终端窗口中正确运行,但在 i3 配置中用作键绑定时却不能。
脚本非常简单:
# Take screenshot
scrot /tmp/screenshot.png
# Pixelate and add central logo
magick /tmp/screenshot.png -scale 10% -scale 1000% -gravity center /home/user/bin/archlogo.png -composite /tmp/lock.png
# Lock using pixelated image & logo
i3lock -e -f -c 000000 -i /tmp/lock.png
Run Code Online (Sandbox Code Playgroud)
脚本被保存~/bin/lock并可执行。该目录也已在我的~/.bash_profile.
没有错误信息,只有终端光标的短暂闪烁。
中的相关行~/.config/i3/config:
# lock screen
bindsym $mod+l exec lock
Run Code Online (Sandbox Code Playgroud)
(删除了 $mod+l 的默认键绑定并重新启动了 i3)。
嘿,更新期间冻结后,我的 btrfs 分区无法挂载。我从我能找到的 Archlinux 和 BTRFS Wiki 中尝试了所有,但这还不够。
我的尝试和输出:
$ sudo mount -t btrfs /dev/sda3 /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sda3, missing codepage or helper program, or other error.
Run Code Online (Sandbox Code Playgroud)
$ sudo btrfs 救援超级恢复 /dev/sda3
parent transid verify failed on 204229967872 wanted 182262 found 182259
parent transid verify failed on 204229967872 wanted 182262 found 182259
Ignoring transid failure
parent transid verify failed on 204229853184 wanted 182261 found 182259
parent transid verify failed on 204229853184 wanted …Run Code Online (Sandbox Code Playgroud) 截至目前,我的 archlinux 系统需要当前版本的 gcc (8.3) 以及 gcc 7.2 和 gcc 5.5(在其他路径中)。
我正在尝试编译源代码,如下所示:
$ ./contrib/download-prerequisites
Run Code Online (Sandbox Code Playgroud)
在构建目录中:
$ ../gcc-5.5.0/configure --prefix=/home/mjonyh/bin/gcc/5.5.0 --disable-multilib --enable-languages=c,c++,fortran
Run Code Online (Sandbox Code Playgroud)
比发现错误
sys/ustat.h: no such file or directory
Run Code Online (Sandbox Code Playgroud)
已安装: binutils gcc-libs libmpc gcc-ada libmpc dejagnu inetutils lib32-gcc-libs doxygen gcc-ada lib32-glibc
更新:我通过手动注释掉gcc-xxx/libsanitizer/sanitizer-common/sanitizer-platform-limits-posix.cc中的 ustat.h解决了该问题(行号 157 和 250)。因为archlinux 弃用了glibc 中的ustat.h。
Archlinux 用户使用 Emacs 作为 C++ IDE,设置如下:company/flycheck/lsp-ui/ccls
我正在尝试将filesystemc++17 中的库用于个人用途,但我无法摆脱 Emacs 中的此错误
ccls : no member named 'filesystem' in namespace 'std'
我的问题的快速示例
#include <iostream>
#include <filesystem>
int main(int argc, char** argv) {
std::filesystem::path filePath("./sample.cpp");
std::cout << filePath.filename() < std::endl;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
使用此命令编译和运行时完全没问题:
clang++ -std=c++17 sample.cpp
输出 : "sample.cpp"
但是 Emacs 中仍然存在“错误”,这有点烦人。我尝试添加.ccls具有以下内容的文件,但这并不能解决问题。
clang++
%cpp -std=c++17 ; Also tried with gnu++17
Run Code Online (Sandbox Code Playgroud)
这是问题的屏幕截图。错误cout和filePath是第一个的后果我猜是因为总的来说一切都很好
有人知道如何解决问题吗?
我正在尝试安装此软件包,ncurses5-compat-libs但由于以下问题,我可以安装。
我做了什么:
1. 是的 ncurses5-compat-libs
有两种类型的错误:要么我将检查“Y”并添加密钥,那么在这种情况下,我将收到如下错误消息
gpg: keyserver receive failed: Permission denied
==> Error: Problem importing keys
Run Code Online (Sandbox Code Playgroud)
或者我将检查为“n”以不添加密钥,我将收到
==> Verifying source file signatures with gpg...
ncurses-6.1.tar.gz ... FAILED (unknown public key 702353E0F7E48EDB)
==> ERROR: One or more PGP signatures could not be verified!
Error downloading sources: ncurses5-compat-libs
Run Code Online (Sandbox Code Playgroud)
2. sudo gpg --recv-keys C52048C0C0748FEE227D47A2702353E0F7E48EDB
我试过手动添加它,但没有用。
3. sudo gpg --recv-keys 702353E0F7E48EDB
还有这个我尝试手动添加,但没有用
4. yay -S --noconfirm --needed ncurses5-compat-libs
5. 试图关闭这个论坛
最少但不是最后
6.我尝试通过以下方式手动克隆存储库
git clone http://aur.archlinux.org/ncurses5-compat-libs.git
cd ncurses5-compat-libs
sudo gpg --recv-keys …Run Code Online (Sandbox Code Playgroud) 在新的MSYS2实例上安装 mingw 时,我遇到了 gcc not found 的问题:
$ g++
bash: g++: command not found
Run Code Online (Sandbox Code Playgroud)
在相对干净的 Windows 10 安装上全新安装 MSYS2:
pacman -Syu
pacman -Su
pacman -S make
pacman -S mingw-w64-x86_64-gcc
Run Code Online (Sandbox Code Playgroud)
看来GCC已经成功安装到该目录了/mingw64/bin
然而我的道路包括
/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:
Run Code Online (Sandbox Code Playgroud)
因此找不到 gcc。
我尝试添加/mingw64/bin,$PATH但这似乎是对潜在问题的临时解决。
我的具体问题是,是否有任何原因说明为什么 mingw 未安装到目录中/usr/bin/或安装未将其自身添加到路径中,或者有任何简单的原因导致此问题。
提前致谢!
我有一个 GitHub Actions 工作流程,它最近在我没有进行更改的情况下停止工作。错误:
==> ERROR: /etc/makepkg.conf not found.
Aborting...
Run Code Online (Sandbox Code Playgroud)
这是从运行# sudo -Eu builder makepkg --printsrcinfo。
日志的顺序似乎是错误的,但在较早的日志中是正确的(可能是由于ls -l输出量大)。
此错误的来源似乎是libmakepkg/util/config.sh.in:
==> ERROR: /etc/makepkg.conf not found.
Aborting...
Run Code Online (Sandbox Code Playgroud)
我在入口点脚本中添加了以下内容:
# Source the config file; fail if it is not found
if [[ -r $MAKEPKG_CONF ]]; then
source_safe "$MAKEPKG_CONF"
else
error "$(gettext "%s not found.")" "$MAKEPKG_CONF"
plainerr "$(gettext "Aborting...")"
exit $E_CONFIG_ERROR
fi
Run Code Online (Sandbox Code Playgroud)
该builder用户在创建build.sh:
echo "Writing SRCINFO..."
# Debug
echo …Run Code Online (Sandbox Code Playgroud)