I\xc2\xb4m 使用 Mac OS el capit\xc3\xa1n 并且我正在尝试遵循OpenNMT pytorch版本的快速入门教程。在训练步骤中,我收到以下警告消息:
\n\nOpenNMT-py/onmt/modules/GlobalAttention.py:177: UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument. \n\nalign_vectors = self.sm(align.view(batch*targetL, sourceL))\n/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/torch/nn/modules/container.py:67: UserWarning: Implicit dimension choice for log_softmax has been deprecated. Change the call to include dim=X as an argument.\n input = module(input)\nRun Code Online (Sandbox Code Playgroud)\n\n第 1 步:预处理数据(按预期工作)
\n\npython preprocess.py -train_src data/src-train.txt -train_tgt data/tgt-train.txt -valid_src data/src-val.txt -valid_tgt data/tgt-val.txt -save_data data/demo\nRun Code Online (Sandbox Code Playgroud)\n\n第 2 步:训练模型(产生警告消息)
\n\npython train.py -data …Run Code Online (Sandbox Code Playgroud) 在wordpress中有没有办法将默认模板文件(index.php)设置为自定义模板?
谢谢.
我遵循了How can I find an element by CSS class with XPath? 它提供了用于按类名选择元素的选择器。问题是,当我使用它时,它会检索到一个空结果“[]”,而且我实际上知道在馈送到 scrapy shell 的 url 中有一个名为“zoomWindow”的 div。

我的尝试:
scrapy shell "http://www.niceicdirect.com/epages/NICShop.sf/secAlIVFGjzzf2/?ObjectPath=/Shops/NICShop/Products/5696"
response.xpath("//*[contains(@class, 'zoomWindow')]")
Run Code Online (Sandbox Code Playgroud)
我查看了许多提供各种选择器的资源。就我而言,该元素只有一个类,因此我使用了使用“concat”的版本,但不起作用并被丢弃。
我在虚拟机中安装了 ubuntu 和 scrapy,只是为了确保这不是我在 Windows 上安装的错误,但我在 ubuntu 上的尝试得到了相同的结果。
我不知道还能尝试什么,你能看到选择器中的任何拼写错误吗?
macos ×1
opennmt ×1
python-3.x ×1
pytorch ×1
scrapy ×1
scrapy-shell ×1
web-scraping ×1
wordpress ×1
xpath ×1