首页 \ 问答 \ 如何使用Dart HttpClient进行DELETE请求?(How can DELETE requests be made with a Dart HttpClient?)

如何使用Dart HttpClient进行DELETE请求?(How can DELETE requests be made with a Dart HttpClient?)

如果您正在使用Dart HttpClient (提供HttpClientRequest )从服务器向另一台服务器发出请求,据我所知,唯一可用的HTTP方法是GETPOST (分别对应post / postUrlget / getUrl函数)。 还有一种方法可以发出PUTDELETE请求吗?


If you're using a Dart HttpClient (which provides an HttpClientRequest) to make requests from a server to another server, as far as I can tell the only HTTP methods available are GET and POST (corresponding, respectively, to the post/postUrl and get/getUrl functions). Is there also a way to make PUT and DELETE requests?


原文:https://stackoverflow.com/questions/22460194
更新时间:2022-07-20 20:07

最满意答案

有两种可能的解决方法来解决错误:

不要导入batch_norm

只需在代码中直接使用tf.contrib.layers.python.layers.batch_norm ,从而省略import语句(不可否认,会造成很多混乱)。

设置环境变量LD_PRELOAD

dennybritz在2月10日发布的github问题中提供了以下修复:

sudo apt-get install libtcmalloc-minimal4
export LD_PRELOAD="/usr/lib/libtcmalloc_minimal.so.4"

请注意,如果您使用的是PyCharm,则必须在运行配置中指定此环境变量(请参阅此文章 ),或者如果将上述export语句放入.bashrc ,则必须从命令行启动PyCharm它继承了环境变量(如本文所述)。

然而,虽然这解决了这个问题,但我不知道为什么首先出现这个错误,并且它应该被认为是应该报告给tensorflow或numpy-quaternion开发人员的错误。


There are two possible ways to work around/fix the error:

Don't import batch_norm

Just always use tf.contrib.layers.python.layers.batch_norm directly in the code, thus omitting the import statement (admittedly, creates a lot of clutter).

Set environment variable LD_PRELOAD

The following fix posted by dennybritz on February 10th in this github issue helped:

sudo apt-get install libtcmalloc-minimal4
export LD_PRELOAD="/usr/lib/libtcmalloc_minimal.so.4"

Note that if you're using PyCharm, you either have to specify this environment variable in the run configurations (see this post) or - if you put the above export statement into your .bashrc - you have to start PyCharm from the command line so that it inherits the environment variables (as explained in this post).

However, while this fixes the issue, I don't know why this error occurs in the first place and if it should be considered a bug that should be reported to either tensorflow or numpy-quaternion devs.

相关问答

更多
  • 不知道你为什么要设置restype = c_void_p ; class DOODLE(Structure): _fields_ = [('ptr', c_void_p)] _libintpointer.C_intpointerfunction.restype = DOODLE 在Linux x86-64上按预期工作。 Not sure why you're setting restype = c_void_p; class DOODLE(Structure): _fields_ = [( ...
  • 当我的系统进行自动更新并获得几个llvm-3.5软件包的新版本(今天)时,此问题得以解决。 以前, opt --version返回 LLVM version 3.5 Optimized build. Built Mar 23 2014 (21:41:30). Default target: x86_64-pc-linux-gnu Host CPU: corei7 现在它又回来了 LLVM version 3.5.0 Optimized build. Built Jan 27 2015 (00:14:4 ...
  • 有两种可能的解决方法来解决错误: 不要导入batch_norm 只需在代码中直接使用tf.contrib.layers.python.layers.batch_norm ,从而省略import语句(不可否认,会造成很多混乱)。 设置环境变量LD_PRELOAD dennybritz在2月10日发布的github问题中提供了以下修复: sudo apt-get install libtcmalloc-minimal4 export LD_PRELOAD="/usr/lib/libtcmalloc_minima ...
  • Valgrind输出显示libpcap (来自nids_run内部)尝试在nids_exit free之后读取内存位置: 例如: ==7504== Invalid read of size 4 ==7504== at 0x654EDC1: ??? (in /usr/lib/libpcap.so.1.2.1) ==7504== by 0x6551EE0: pcap_loop (in /usr/lib/libpcap.so.1.2.1) ==7504== by 0x5250E65: nids_ ...
  • 您没有初始化Library变量:请参阅FT_LIBRARY文档 。 你应该使用FT_Init_FreeType : FT_Init_FreeType 在FT_FREETYPE_H(freetype / freetype.h)中定义。 FT_EXPORT(FT_Error)FT_Init_FreeType(FT_Library * alibrary); 初始化一个新的FreeType库对象。 由此函数注册的模块集在构建时确定。 output alibrary新库对象的句柄。 返回FreeType错误代码。 0 ...
  • 你得到的错误是在这一行: jint rc = JNI_CreateJavaVM(&jvm, (void**)&&env, &vm_args); 你要求指向env的指针的地址; 而如果你看一下参考示例来源 : #include /* where everything is defined */ ... JavaVM *jvm; /* denotes a Java VM */ JNIEnv *env; //