这是我的结构
我试图从header.ejs文件加载main.css文件,无法找到它。
此代码位于我的头文件中:
<!DOCTYPE html> <html>
<head>
<title>Hello and wellcome to my album</title>
<link type="text/css" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="../../public/stylesheets/main.css">
</head>
<body>
答案 0 :(得分:3)
尝试返回2个目录,而不是1个。
像这样:
pip uninstall pkg-resources==0.0.0
答案 1 :(得分:1)
链接应如下所示,因为您有2个子文件夹,然后您将获得公用文件夹和样式表
VARNISH_LISTEN_PORT=443
# how to add SSL certs?
答案 2 :(得分:1)
尝试
image = img_to_array(load_img('1.png'))
Yimage = img_to_array(load_img('1y.png'))
image = np.array(image, dtype=float)
Yimage = np.array(Yimage, dtype=float)
X = rgb2lab(1.0/255*image)[:,:,0]
Y = rgb2lab(1.0/255*Yimage)[:,:,1:]
Y /= 128
X = X.reshape(1, 32, 32, 1)
Y = Y.reshape(1, 96, 96, 2)
# Building the neural network
model = Sequential()
model.add(InputLayer(input_shape=(None, None, 1)))
model.add(UpSampling2D((3, 3)))
model.add(Conv2D(8, (3, 3), activation='relu', padding='same', strides=2))
model.add(Conv2D(8, (3, 3), activation='relu', padding='same'))
model.add(Conv2D(16, (3, 3), activation='relu', padding='same'))
model.add(Conv2D(16, (3, 3), activation='relu', padding='same', strides=2))
model.add(Conv2D(32, (3, 3), activation='relu', padding='same'))
model.add(Conv2D(64, (3, 3), activation='relu', padding='same'))
model.add(Conv2D(32, (3, 3), activation='relu', padding='same', strides=2))
model.add(UpSampling2D((2, 2)))
model.add(Conv2D(32, (3, 3), activation='relu', padding='same'))
model.add(UpSampling2D((2, 2)))
model.add(Conv2D(16, (6, 6), activation='relu', padding='same'))
model.add(UpSampling2D((2, 2)))
model.add(Conv2D(2, (3, 3), activation='tanh', padding='same'))
model.compile(optimizer='rmsprop', loss='mse')
model.fit(x=X, y=Y, batch_size=1, epochs=2500)
print(model.evaluate(X, Y, batch_size=1))
output = model.predict(X)
output *= 128
Y *= 128
# Output colorizations
cur = np.zeros((96, 96, 3))
cur[:,:,0] = Y[0][:,:,0]
cur[:,:,1:] = output[0]
imsave("img_result.png", lab2rgb(cur))
imsave("img_gray_version.png", rgb2gray(lab2rgb(cur)))
<link type="text/css" rel="stylesheet" href="../../public/stylesheets/main.css">
从当前选择父目录。
(..)2次,因为首先,您需要返回2个目录,然后转到公共然后再找到样式表,然后是main.css
答案 3 :(得分:1)
在app.js中我添加了:
app.use(express.static("public"));
我改变了header.ejs中的:
<link type="text/css" rel="stylesheet" href="stylesheets/main.css">
我正在使用NodeJS
答案 4 :(得分:0)
问题是您的样式表路径设置错误。
<!DOCTYPE html> <html>
<head>
<title>Hello and wellcome to my album</title>
<link type="text/css" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="../../public/stylesheets/main.css">
</head>
<body>
您只是指向从局部视图到视图的文件夹。您需要一个到您的站点根目录的文件夹,就像我指出的那样。通常,您可以使用直接指向项目根文件夹的/public/stylesheets/main.css
答案 5 :(得分:0)
这是一个nodejs app,路径应该如下。
<link rel="stylesheet" type="text/css" href="/stylesheets/main.css" />
如果你的路径是静态的:
<link rel="stylesheet" type="text/css" href="stylesheets/main.css" />